WordPress.org

Ready to get started?Download WordPress

Forums

Imsanity
[resolved] Does Imsanity resize the images already on a Site? (27 posts)

  1. member11
    Member
    Posted 2 years ago #

    Hi
    Does Imsanity resize the images already on a Site or only new images uploaded after the plugin has been installed?
    thanks

  2. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    It only changes new images after the plugin is installed.

    I was thinking about making a "bulk convert old images" button perhaps on the settings page if that is a feature people are interested in...?

  3. esmi
    Forum Moderator
    Posted 2 years ago #

    There's already a plugin for that - Regenerate Thumbnails: http://wordpress.org/extend/plugins/regenerate-thumbnails/

  4. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for posting that - Regenerate Thumbnails looks very interesting. It's similar but not quite exactly what I had in mind. I use some of Viper's other plugins so I'm sure the quality is good.

    If I were to write a bulk converter feature for Imsanity, it would resize all of the existing originals (not thumbnails) in order to clear up disk space in the blog. People who have quota limits on their blog could possibly recover a lot of space by downsizing images.

  5. rgkeenan
    Member
    Posted 2 years ago #

    I would love to see a bulk converter tool for previously uploaded artwork. We have thousand of images from photographers that is chewing up GB's of disk space.

  6. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    I did some investigation and it is definitely possible. work is killing me at the moment but i definitely will get around to this at some point. i have some sites where it would be really helpful as well.

  7. Shelley Keith
    Member
    Posted 2 years ago #

    This is something I'm seriously interested in, along with single-config multi-site support.

  8. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    Cool, i have both of those on my list to do when i have some down-time

  9. rgkeenan
    Member
    Posted 2 years ago #

    Fantastic.. looking forward to it.

  10. Jesse McFarlane
    Member
    Posted 2 years ago #

    Adding to the voices who would love a bulk cleanup option. There's a serious need for this plugin as-is but adding bulk cleanup would be huge.

    I'd also love a radio button to disable the Imsanity girl and the blurb--clients who want to maintain admin (meaning you aren't hiding the plugin section from them) don't need to see that. It's cute but probably only needs to exist on the wordpress.org/extend page, not on the plugin settings screen.

  11. ChrisCree
    Member
    Posted 2 years ago #

    @verysimple This is a fabulous plugin you have here. I've been manually resizeing images before I uploaded them since 2005. It's an extra hassle and most users who are less tech savvy just don't bother. Your plugin eliminates that extra step. Thanks!

    Please count my vote for a batch resizing feature for already uploaded images. The WordPress importer chokes when trying to bring in huge images. It would be very useful to be able to resize them on the original site before importing them to the new site.

    Perhaps the AJAX Thumbnail Rebuild plugin could be a useful starting point for that. I use it all the time when retheming sites to get new thumbnail sizes. You might be able to modify the code for batch resizing original images.

  12. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    cool, thanks. I'm working on those new features slowly. the multi-site configuration is proving to be as much of a PITA as I expected due to nobody on the WordPress dev forums being able to give a definitive answers where to save global (server-wide) data, but I've finally given up on using any "standard" and am just doing it my own way.

    The bulk re-sizer shouldn't be too difficult, but I just want to make sure it's solid since it could potentially mess up all of your images!

  13. evster
    Member
    Posted 2 years ago #

    This looks like an amazing plugin! I am excited to try it out. Thank you for your hard work and support thus far.

    Just want to add another check in the "yes" column for the bulk resize of already-uploaded images feature. That would be killer.

    Thanks.

  14. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    ok, i just released imsanity version 2.0.0 which includes a "bulk resize" feature. on the Imsanity settings page there is a button to search for large images. It's available for download in the usual place.

    I would definitely appreciate any feedback. I'm adding the disclaimer that this is a "beta" feature so please help me to make sure it's stable by backing up your wp-content/uploads folder before proceeding and/or only converting 1 or 2 images and then verify that everything is ok. This plugin does go in and mess with your original images, so it has the potential to destroy all of your images in one click! With great power comes great responsibility - respect!

  15. evster
    Member
    Posted 2 years ago #

    Thank you verysimple for your hard work on this plugin!

    Unfortunately I was under the gun with the project that needed the bulk image resizing so I handled it manually on my own.

    Will test out this new feature and provide feedback.

    So far the plugin is great and I plan on using for all of my WordPress sites with clients that upload significant amounts of photos.

  16. jodik71
    Member
    Posted 2 years ago #

    @verysimple

    What a great plug-in! I just used it to resize 250 images (after testing a few, as you suggested) and it worked very well.

    The question I have is, how does the "search images" decide which images to select for editing? There are many more original sized image (right off a camera, unfortunately) that I'm trying to clean up and the plug in indicates that there are no more images to re-size when I try to search again. Does it search the entire media library; do the images have to be attached to something....? It appears to have only selected the first 250 images in one folder "wp-content/uploads/2011/10". Is there something I can do to make it find the other images?

    I'd love to use your plug-in to finish this "house cleaning" task. It is a fantastic addition to the WordPress plug-ins!

  17. jodik71
    Member
    Posted 2 years ago #

    @verysimple again

    I did a bit of experimenting and found that if I edit the limit you placed on the number of images found in the bulk search from 250 to 300 (in ajax.php), I find the next 50 large images that I have. I tried re-sizing just one of them using the bulk feature and it worked.

    I am afraid to go further with this on my own, since it has the potential of screwing something up; I don't have enough experience to know if I'm on the right track or not. I see your comment in the code "// make sure we only return up to 100 records so we don't overload the ajax features". I would guess I would need to raise the limit above 300 (or some other way to find the additional images), and I have no idea if this is good idea or not....

    Thanks again for the fantastic plug-in!

  18. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    You're right, images past #250 weren't being returned. the counter was in the wrong place. I just fixed that and submitted version 2.1.3 which should be available soon. It still limits to 250 in a single pass, but after you re-size those 250, you can search again and get another 250.

    the search function does query the database, not the file system. so any images that were uploaded outside of the wordpress uploader wouldn't be returned. but anything uploaded through wordpress should be there.

    The 250 limit is somewhat arbitrary to keep the page stable. You could change that number to something higher if it helps and most likely it would be ok. i'd say you could probably raise the limit into the thousands. The worst that would happen is your browser would get really sluggish and possibly the page would stop responding. But it wouldn't hurt the images.

    Thanks for alerting me!

  19. jodik71
    Member
    Posted 2 years ago #

    Thanks again for the great plug-in! The fix was just what I needed, and I've just finished re-sizing several batches of really huge images down to reasonable sizes. You saved me an amazing amount of time!

  20. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    great! Feel free to give Imsanity a good rating and click the "It Works" button in the plugin directory!

  21. evster
    Member
    Posted 2 years ago #

    Just wanted to let you know that I had a chance to try the bulk resizer on another site today and it worked like a charm!

    Thanks again! You rock!

  22. zsero
    Member
    Posted 2 years ago #

    Hi Verysimple,

    First of all, I would like to say a HUGE thanks for developing this plugin. My problem is that not all the images seems to be listed in the batch resizer. It's not the 250 limit, I edited it to 2500 and it's still the same. After one batch resizing the plugin believe that it has resized all the images, while it hasn't. There are images which were missing from the list and not listed even after the resize.

  23. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    Hmm, well the simple thing to verify first is that the images are actually larger than your configured limit? Imsanity won't offer to resize images that do not exceed the max size.

    If that's not the case, the next thing to know is that all images that are uploaded via regular WordPress upload functions will have a matching record in the wp_posts table. Imsanity looks in the database for files - it doesn't look at the filesystem. This record in the database also contains metadata about the image, including the size. Imsanity does not go recursing through your folders examining images, it just looks at this table to determine everything.

    If an image is uploaded by a plugin or simply just uploaded directly to the server via FTP and it doesn't have a matching record in the wp_posts table then Imsanity will not be aware of it's existence. Or if the metadata for the image does not show the correct image size, then that could be another reason (though I think that would be unlikely).

    I would start the detective work by locating one single image that you suspect should be resized but is not being handled by Imsanity. Then check the size first, then check the database to see if it's in there, then finally look at the metadata and see what that looks like as well.

  24. zsero
    Member
    Posted 2 years ago #

    Hi Verysimple,

    All the images were uploaded by the normal "attach photo", but about 50% of them were missed by the script.

    Anyway, I found an amazing solution, but it requires shell access:

    #!/bin/bash
    for img in find . -name *.jpg -printf '%p\n'
    do
    echo $img;
    mogrify -quality 90 -strip -resize "960x800>" $img;
    done

  25. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    were you able to see if they have matching database records in the wp_posts table? If they do and Imsanity is missing them for some reason I'd like to fix it.

    Also, if there are records in there and you resized them using the shell script, then WordPress will have the wrong meta data about the images. (possibly not a major issue, though may confuse WordPress when you embed full-sized images into a post)

  26. zsero
    Member
    Posted 2 years ago #

    Hi verysimple,

    I think the problem is not on your side, it's something with WordPress. On the filesystem, I have files just differencing in a number at the end.

    IMG_3391sat.jpg
    IMG_3391sat1.jpg
    IMG_3391sat2.jpg
    IMG_3391sat3.jpg

    They all have the same size and are the same images. In WordPress what happens is that their post_title is the same, but their post_name differs. Also their guid differs.

    To show in SQL, this is what happens:
    select post_title, post_name, guid from wp_posts where post_title like "%IMG_3391sat%"
    >
    IMG_3391sat img_3391sat .../2011/09/IMG_3391sat.jpg
    IMG_3391sat img_3391sat-2 .../2011/09/IMG_3391sat1.jpg
    IMG_3391sat img_3391sat-3 .../2011/09/IMG_3391sat2.jpg
    IMG_3391sat img_3391sat-4 .../2011/09/IMG_3391sat3.jpg

    If you group by post_title, there will be only one returned. If you group by post_name all 4 will be returned. So I think to fix your code you just need to query using post_name and not post_title.

  27. Jason
    Member
    Plugin Author

    Posted 2 years ago #

    hmm, i'm not sure what the deal is. imsanity neither looks at the post_title nor post_name columns. The query actually looks like this so perhaps you could see why this might be missing the rows from your system..?

    select * from posts inner join postmeta
    on posts.ID = postmeta.post_id and postmeta.meta_key = '_wp_attachment_metadata'
    where post_type = 'attachment'
    and post_mime_type like 'image%'
    and post_mime_type != 'image/bmp'

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags