Results 1 to 9 of 9

Thread: Media Manager Size Deleter?

  1. #1
    tommyvallier's Avatar
    tommyvallier is offline Hello World
    Join Date
    Mar 2009
    Location
    Kingston, ON
    Posts
    11

    Default Media Manager Size Deleter?

    Wholly wow has it been a while since I came in here. *blows off dust* Sorry. :( *blush*

    I'm trying to... persuade a client to stop using FTP for uploads and switch to the built-in media manager. His original complaint was that MM wasn't setting things in year/month folders (It was disabled for some reason) - so I fixed that. Then he moaned that MM would create 4 versions at sizes he didn't like. So I fixed that, too. Now he's saying that he's sticking with FTP so that he can delete the smaller sizes (Which are just scales, not crops, so they can be made on upload) after they're off the front page and not needed any more. *sigh*

    Obviously, he COULD go in through FTP and delete them from the uploads folder. But if I toss that option at him, I'm done for - my whole argument has been that he can do things without the second program. Telling him to open FTP to delete image sizes will net a "But then I'm just using it anyway." reply.

    Any thoughts? Anyone seen a plugin that enhances MM and lets you delete specific sizes?

    Thanks - and I'll try to come back more.

  2. #2
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by tommyvallier View Post
    Wholly wow has it been a while since I came in here. *blows off dust* Sorry. :( *blush*

    I'm trying to... persuade a client to stop using FTP for uploads and switch to the built-in media manager. His original complaint was that MM wasn't setting things in year/month folders (It was disabled for some reason) - so I fixed that. Then he moaned that MM would create 4 versions at sizes he didn't like. So I fixed that, too. Now he's saying that he's sticking with FTP so that he can delete the smaller sizes (Which are just scales, not crops, so they can be made on upload) after they're off the front page and not needed any more. *sigh*

    Obviously, he COULD go in through FTP and delete them from the uploads folder. But if I toss that option at him, I'm done for - my whole argument has been that he can do things without the second program. Telling him to open FTP to delete image sizes will net a "But then I'm just using it anyway." reply.

    Any thoughts? Anyone seen a plugin that enhances MM and lets you delete specific sizes?

    Thanks - and I'll try to come back more.
    Can you hook into the intermediate_image_sizes filter, to remove the offending image sizes?

    The default is:
    PHP Code:
    $default_sizes apply_filters'intermediate_image_sizes', array('large''medium''thumbnail') ); 
    Couldn't you do something like:
    PHP Code:
    $default_sizes apply_filters'intermediate_image_sizes', array( 'thumbnail') ); 
    Or, if he doesn't want ANY resized images:
    PHP Code:
    $default_sizes apply_filters'intermediate_image_sizes', array( '' ) ); 
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  3. #3
    tommyvallier's Avatar
    tommyvallier is offline Hello World
    Join Date
    Mar 2009
    Location
    Kingston, ON
    Posts
    11

    Default

    Well, setting all of the sizes in Settings > Media to 0x0 actually disables creation, so that part was easy. Hooray for code-free fixes. But he actually does use smaller versions. There's a 640x300 banner space in the featured area, then they fall to a 215x100 image in the 'Other Stories' area below. He makes both of those by hand, but I can (and did) set the image uploader to make those automatically already.

    The problem is that once the story is no longer featured, it doesn't need the 640x300 version any more. And once it's off of the front page entirely, the 215x100 version can go away, too. He's all about conserving disk space - so he's been manually uploading all three sizes (original, featured and home page) when the story gets published, then deleting the featured and home page sizes when it's fallen from the front.

    It's a strange request, I know. But he keeps complaining that "all stories have to go through him for image resizes and uploads" and I'd love to show him that everything he's doing with photoshop and FTP can be done without.

  4. #4
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by tommyvallier View Post
    Well, setting all of the sizes in Settings > Media to 0x0 actually disables creation, so that part was easy. Hooray for code-free fixes. But he actually does use smaller versions. There's a 640x300 banner space in the featured area, then they fall to a 215x100 image in the 'Other Stories' area below. He makes both of those by hand, but I can (and did) set the image uploader to make those automatically already.

    The problem is that once the story is no longer featured, it doesn't need the 640x300 version any more. And once it's off of the front page entirely, the 215x100 version can go away, too. He's all about conserving disk space - so he's been manually uploading all three sizes (original, featured and home page) when the story gets published, then deleting the featured and home page sizes when it's fallen from the front.

    It's a strange request, I know. But he keeps complaining that "all stories have to go through him for image resizes and uploads" and I'd love to show him that everything he's doing with photoshop and FTP can be done without.
    I have your answer:

    Don't create ANY custom sizes. Just use the original size.

    Then, when you call the image as featured or on the front page, pass an array( 'width', 'height' ) as the image-size argument.

    So the featured image call:
    PHP Code:
    <?php the_post_thumbnail'featured' ); ?>
    Becomes this:
    PHP Code:
    <?php the_post_thumbnail( array( '640''300' ); ?>
    And the front-page image:
    PHP Code:
    <?php the_post_thumbnail'frontpage' ); ?>
    Becomes this:
    PHP Code:
    <?php the_post_thumbnail( array( '215''100' ); ?>
    One image, resized on-the-fly.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  5. #5
    Ryan's Avatar
    Ryan is offline WordPress Legend
    Join Date
    Jan 2009
    Location
    New Zealand
    Posts
    2,801

    Default

    Holy schomly Chip! I had no idea that was possible!

    Wish I'd known that was possible before.

    EDIT: Hang on, does that actually resize the image? Or just change the width and height attributes?

  6. #6
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by Ryan View Post
    Holy schomly Chip! I had no idea that was possible!

    Wish I'd known that was possible before.

    EDIT: Hang on, does that actually resize the image? Or just change the width and height attributes?
    I believe it merely scales the image - which would not be a great solution for 99% of use cases, but is absolutely perfect for THIS extreme-edge-case situation.
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  7. #7
    tommyvallier's Avatar
    tommyvallier is offline Hello World
    Join Date
    Mar 2009
    Location
    Kingston, ON
    Posts
    11

    Default

    Quote Originally Posted by chipbennett View Post
    I believe it merely scales the image - which would not be a great solution for 99% of use cases, but is absolutely perfect for THIS extreme-edge-case situation.
    As brilliant of a solution as this is (and it is a pretty brilliant solution) - it won't work. Well - it could, I suppose.

    I'm using Genesis with the add-on Featured Widget Amplified plugin to give me more control over that widget. It's that widget that powers the "Other Stories" area - and it's fine with using an image, but only when they're hooked into the media gallery. That's part of what triggered the whole hunt, actually.

    I could probably edit the plugin to do it this way... But I try to avoid editing plugins as a rule.

    *sigh* The hunt continues.

  8. #8
    chipbennett's Avatar
    chipbennett is offline WordPress Legend
    Join Date
    Feb 2009
    Location
    St. Louis, MO
    Posts
    1,997

    Default

    Quote Originally Posted by tommyvallier View Post
    As brilliant of a solution as this is (and it is a pretty brilliant solution) - it won't work. Well - it could, I suppose.

    I'm using Genesis with the add-on Featured Widget Amplified plugin to give me more control over that widget. It's that widget that powers the "Other Stories" area - and it's fine with using an image, but only when they're hooked into the media gallery. That's part of what triggered the whole hunt, actually.
    Well, the image *is* hooked into the Media Manager... do you mean, the Widget only allows selection of image *sizes* that are registered with the Media Manager?

    I could probably edit the plugin to do it this way... But I try to avoid editing plugins as a rule.

    *sigh* The hunt continues.
    It seems to me that this would be a pretty useful addition to the Plugin code - to allow ad hoc image sizes. Perhaps the developers would welcome a patch?
    WP TurnKey - Turn-Key WordPress installation and maintenance services
    WordPress user since 2005 | @chip_bennett | chipbennett.net | cbnet Plugins

  9. #9
    tommyvallier's Avatar
    tommyvallier is offline Hello World
    Join Date
    Mar 2009
    Location
    Kingston, ON
    Posts
    11

    Default

    Quote Originally Posted by chipbennett View Post
    Well, the image *is* hooked into the Media Manager... do you mean, the Widget only allows selection of image *sizes* that are registered with the Media Manager?
    Yeah, The check box says 'Show Featured Image' and then provides a drop-down showing 'Image Size'.

    My clients decided he wants to keep manually uploading images and using a custom field to reference it. The previous theme used a custom field, so he's used to that, anyway.

    Off to the code I go, I suppose. Nice to see that all that work that went into Media Manager and the built-in thumbnail feature is being put to good use. *sigh*

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •