gambitph / WP-OTF-Regenerate-Thumbnails

Automatically regenerates your thumbnails on the fly when thumbnail sizes change.
https://wordpress.org/plugins/otf-regenerate-thumbnails/
GNU General Public License v2.0
77 stars 16 forks source link

Generating image size completely on the fly #15

Open stuartha13 opened 9 years ago

stuartha13 commented 9 years ago

Hi there

With BFI_Thumb I can generate a thumbnail (and creates a cached file in uploads/bfi_thumb/)only when I want to insert the image into the page, which is exactly what I want to do with my images:

$params = array( 'width' => 400 );
$image = bfi_thumb( "http://mysite.com/myimage.jpg", $params );
echo "<img src='$image'/>";
  1. Can I do the same thing with OTF Regen Thumbnails, instead of thumbs being generated on file upload/media size change?
  2. If I can do this, then how?
  3. Do the generated thumbnails also land up in their own folder in uploads/ (like BFI_Thumb does it)?

Thanks!

Basilakis commented 9 years ago

Yeap. I am also interested on that one! :)

eoutvik commented 9 years ago
  1. yes
  2. readme on https://github.com/gambitph/WP-OTF-Regenerate-Thumbnails Basically just use these WordPress functions every time you display images: wp_get_attachment_image_src(); wp_get_attachment_image(); the_post_thumbnail(); get_the_post_thumbnail(); Like this: wp_get_attachment_image( $attachment_id, array(160, 90) );
  3. nope, but does that really matter?