thumbc.php image( 'screenshot-1.png' ), array( 'width' => 300 ) ) to your header. Read comment for basic instructions.Īs said, the function / file name is not yet set. If you are adventurous you can try out this gist until I release the plugin for real. …or get the original data (scroll example right)… $thumb = thumbCompressFunction( $page->image(), array( 'width' => 300 ) )->original() …or get the data… $thumb = thumbCompressFunction( $page->image(), array( 'width' => 300 ) ) The release will be on github, free for everyone.Įxample echo thumbCompressFunction( $page->image(), array( 'width' => 300 ) ).It will respect thumbs.filename and thumbs root folder path.No txt-files are added, just compressed thumbnails.It will return the compressed image if it exist, else it will return the original thumbnail.It will only try to compress the thumb with tinypng if the compressed image does not already exists.It uses the exact same arguments as the thumb() function.Please help me choose a function name! Give me own suggestions if you have any. The only problem left is naming the function that will replace the thumb() function. I have made a Kirby plugin that are compressing thumbnails. Open(OUTFILE,">$output") || die "\nCould not open $output OUTFILE $data Here is the code… hook('', function( $page ) readdir(DIR) Picture climbing and a tight selection Scale your pictures to store them in various sizes. Immediately save your pictures with outstanding JPEG and PNG compression. If you DON’T want to overwrite the same file, change the last $input to $output instead. TinyPNG Photoshop Plugin Great Features: Preview and save straight No need for extra actions in your workflow.Download and put it in the same folder.Save it as /tinypng/tinypng.php in your plugin folder.Another great things is that Kirby now support hooks! If you need to compress more images each month it costs, but it’s at a low price ($0.009 per image).Ĭompressing images is good for loading time, better user experience and SEO.Ī good thing is that there is an Tinypng API. Each month you can compress up to 500 images free. One of the best services for compressing images is.
0 Comments
Leave a Reply. |