WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Cropping an image regenerates thumbnails, scaling doesn't (6 posts)

  1. Madlandproject
    Member
    Posted 1 year ago #

    Hello everyone,

    I am currently implementing a gallery for a client website on two custom post types. To minimize possible mistakes on the client's part, I am retrieving the attachments in a custom loop on the single-posttype.php page instead of using the gallery shorttag.

    I am a little confused by the media manager in WordPress : If I upload an image, called "myphoto.jpg" for example, WordPress will generate "myphoto-120x80.jpg" and "myphoto-300x199.jpg" (my thumbnail and small image sizes respectively). As one would expect.

    Now if I crop the image to a ratio specific to my site (642x425 in my case), and click save, WordPress will generate "myphoto-randomchars-120x80.jpg" and "myphoto-randomchars-300x199.jpg". So far so good.

    Now the weird part : If I scale the image (by clicking the scale image link, entering the new dimensions and clicking the "scale" button), then the image is automatically saved with new randomchars appeneded to the name, but the thumbnails aren't generated.

    Is this an oversight? Is this by design? I have seen similar issues pop up and I know about the regenerate thumbnails plugin and the TimThumb class but these solutions don't seem very elegant.

    One solution would be to change the "medium" or "large" size in the media settings, or even a custom size, but I'm not keen on multiplying the number of files.

    How do you fine people implement and explain media management for clients who aren't tech-savy ?

    Thank you for your time

    Robin

  2. Scott Fennell
    Member
    Posted 1 year ago #

    What's your objection to the regenerate thumbnails plugin?

  3. Madlandproject
    Member
    Posted 1 year ago #

    Hi Scott

    Either my client has to run it after scaling every photo, or run it once after uploading several (which means checking the box next to each photo in the media manager) or regenerating all thumbnails (which means potentially uselessly reprocessing hundreds of files in the future). As I mentioned, he isn't very tech orientated person and the less steps involved, the better.

    I have decided to go with registering additional image sizes. It looks like multiple files is going to be a simpler problem to fix, and it's not a problem that will arise soon.

  4. s_ha_dum
    Member
    Posted 1 year ago #

    Now the weird part : If I scale the image (by clicking the scale image link, entering the new dimensions and clicking the "scale" button), then the image is automatically saved with new randomchars appeneded to the name, but the thumbnails aren't generated.

    I am confused, if I remember correctly, your thumbnail is going to be the same size no matter how large the original image is. A 500x500 image would have, say, an 80x80 thumbnail. If you scale the original to 300x300, you'd still have an 80x80 thumbnail. Why would it regenerate? What would be the point? In other words, those thumbnails aren't generated proportionally to the original image size.

    One solution would be to change the "medium" or "large" size in the media settings, or even a custom size, but I'm not keen on multiplying the number of files.

    You won't multiply files. You will just change the sizes. Files already present will remain, of course, which I believe is the reason for the 'regenerate thumbnails' plugin mentioned above.

    How do you fine people implement and explain media management for clients who aren't tech-savy ?

    Media management doesn't seem too complicated to me, except for the 'Gallery feature'. That is horrible. I don't think I have ever had to explain the media management to anyone. I have had to explain the 'gallery' feature and we all ended up stunned. I have no idea who cooked it up or why it was cooked up the way it is, but it does not work the way I'd expect or the way anyone I talked to expected. The problem is that the system shoves all attached images into a 'gallery' instead of letting the user specifically and intentionally create galleries.

  5. Madlandproject
    Member
    Posted 1 year ago #

    Your thumbnail is going to be the same size no matter how large the original image is. A 505x500 image would have, say, an 80x80 thumbnail. If you scale the original to 300x300, you'd still have an 80x80 thumbnail. Why would it regenerate? What would be the point? In other words, those thumbnails aren't generated proportionally to the original image size.

    Good point. The problem was I was using the full size URL as a base for thumbnail URLs in a Javascript file. Definitely not best practice, I know so I've update the script : Instead I'm using a HTML data attribute to pass the thumbnail url

    You won't multiply files. You will just change the sizes. Files already present will remain, of course.

    I now have added two image sizes for my gallery, seeing as I want to keep Medium and Large for future use in content. The size of multiple files shouldn't be a problem, the site has decent hosting, and that is the easiest part of the equation to solve when the problem does arise.

    I don't think I have ever had to explain the media management to anyone.

    I wish I had your clients ;-) I've had to explain to a client's specifically trained "Webmaster" that you can't drag and drop files on to a burned CD like a USB drive (the client then proceeded to buy Adobe Flex Builder so they could maintain the app we built for them...)

  6. s_ha_dum
    Member
    Posted 1 year ago #

    I wish I had your clients ;-)

    :) I have my own stories :)

    Besides, most of my trouble is with staff, not with clients... :(

Topic Closed

This topic has been closed to new replies.

About this Topic