Thumbs filename, width and height not working like expected




In real life


Here is why

When creating the thumbnail I let the thumb calculate the height.

thumb( $page->image(), array('width' => 300) );

However I still expect it to rename the file by the size even if I don’t set it.

Bug or feature?

  • Is how it work now expected behaviour?
  • Will it be changed in the future to reflect the image size, not the function call?
  • If not, can we add another height-value, like “autoheight” to have the height in the filename even if it’s not set by the template?

It is kind-of expected behavior, but you can see why it works like this in the code.
Actually, the fitting gets done in the driver, and that’s after the filename gets determined.

I think it makes sense, as the filename should reflect what was requested by the user, not what the result is.

PS: Please open such issues directly on GitHub, as having them here is only useful if it’s something worth discussing. Once you are pretty sure it’s an actual bug, having issues tracked on GitHub makes more sense to keep the overview over all issues.

For my perspective it is a bug, but I also understand how it’s probably ment to work and why.

I still don’t know if this is a bug or a feature. Should I still open an issue on GitHub instead?

Alright, that’s a valid point.
Just for my understanding: Why do you want to customize your thumbs and especially in that way? I currently don’t understand why having calculated values in the filename is relevant in this case, but maybe that can change. :wink:

OK, then it’s totally fine to have it here until the community has decided if it is a bug or not.
Just in general: You opened a lot of issues in the forum already. GitHub is better for issue tracking (this forum category is mostly for non-developers not familiar with GitHub), so for stuff you know should change (at least in your opinion) GitHub makes more sense.

Maybe I still suffering from the WordPress illness. They use the filenames like that.

For me I just want to see what sizes I have of each image, for an overview, like this…


For me the width is often most important but sometimes I might have a cropped image and then the height is important.

I think the default hashed filenames are crap (sorry for the ones I hurt). The hash don’t tell me anything at all.

Yeah, and in that case, the height would be included, as it is in the option array.

That’s a valid opinion. But in my opinion, the thumb filenames ought to be unique. If you have the same image filename in two pages, it all collapses. That’s why the hash is in there by default.
I think that thumbs should be completely automatic, never altered manually (only by some kind of size optimizer, but they don’t care about filenames) and work and live in the background. I personally didn’t have to look at the generated thumbs in the folder structure once.

I agree, the thumbs are not visible in the panel, so a user will not see them and thus the information the file name provides, is of no importance as long as you don’t go visiting the file system. And since the size of the thumb is determined by the options, to get the right thumb all you need to do is change the settings if you need another file size. So you don’t have a reason to care if the file is there or not, because it is generated automatically anyway.

@texnixe @lukasbestle

Thumbs in page folder

I think this is a better way for storing thumbs…

The main reason is that they will be cleaned up when a page is deleted. Another reason is that the filenames don’t collide when they are in a page folder.

For more reasons, scoll down in the linked post to see my list.

About file names

Because I’m not a robot I like to see the size instead of a hash, at least for debuging.