WordPress.org

Ready to get started?Download WordPress

Ideas

Image size as suffix instead of image dimensions

  1. José Luís
    Member

    I'd like to suggest the ability to use image size as a suffix, instead of the image's dimensions.

    I mean, on a blog with thumbnail size of 100x100, instead of image-100x100.jpg, we could see image-thumbnail.jpg.

    Posted: 4 years ago #
  2. Mark
    Member

    12345

    Sensible and flexible. This could be very useful in theming. Less hardcoding is always good.

    Posted: 4 years ago #
  3. Michael Fields
    Themer

    12345

    I believe that this is the way that WordPress used to save images long ago. At first, I didn't understand why the naming convention was changed, but after a while, I fully understood.

    I think that the current naming convention of appending the dimensions (100x100) to the end of the filename is the best way to store the image. Take for example a hypothetical situation where there is a blog with multiple plugins installed + a theme that sets the size of "post thumbnails"/"featured images".

    Maybe the theme has the following code supplied in functions.php:

    set_post_thumbnail_size( 100, 100, true );

    and one of the plugins has the following:

    add_image_size( 'my_plugin_image', 100, 100, true );

    and another plugin has:

    add_image_size( 'another_plugin_image', 100, 100, true );

    In the scenario you present, WordPress would be storing 3 images of the exact same size under three different names. This would waste space especially in image heavy blogs.

    I think that the current method is well thought-out and I personally would not like to see it changed.

    Posted: 4 years ago #
  4. José Luís
    Member

    @Michael, makes sense. But there are cases when a user changes his image sizes and has to change all references to that image because of the suffix.

    Couldn't this be set as an option?

    Posted: 3 years ago #
  5. boykenan
    Member

    12345

    When theming, I've often wished there were a predictable way to anticipate what an image of a particular size's filename would be. I would love to see this change.

    Posted: 3 years ago #
  6. Pat Hawks
    Member

    12345

    But there are cases when a user changes his image sizes and has to change all references to that image because of the suffix.

    Wouldn't you need to edit the HTML in all references to that image anyway to add the new width and height attributes?

    Posted: 2 years ago #
  7. José Luís
    Member

    @Pat Hawks,

    That's true. But in that case one could: set those attibutes programatically with a generic function or ignore w3 standards and omit them.

    Posted: 2 years ago #
  8. B_Dark
    Member

    12345

    any solution?

    Posted: 2 years ago #
  9. B_Dark
    Member

    12345

    So there won't be any objections, it should be added as an extra option with what kind of suffix it would be the name of the file name of photo. And if it's needed we can donate to add it. I personally don't have any problem.

    Posted: 2 years ago #
  10. letusrise
    Member

    Yeah, there should be a filter for this. To be honest, it is really useful in terms of theming.

    :)

    Posted: 2 years ago #

RSS feed for this topic

Reply »

You must log in to post.

  • Rating

    12345
    9 Votes
  • Status

    Sorry, not right now