JamesHeinrich / phpThumb

phpThumb() - The PHP thumbnail generator
Other
315 stars 97 forks source link

Suggestion: Download filename (save image as) customizations #123

Closed badbadmonkey closed 6 years ago

badbadmonkey commented 6 years ago

It would be suitable to have something custom and at least unique for the save-image-as default filenames. I looked at hacking it but can't quite figure what I would add.

$downloadfilename = phpthumb_functions::SanitizeFilename(is_string($this->sia) ? $this->sia : ($this->down ? $this->down : 'phpThumb_generated_thumbnail'.'.'.$this->thumbnailFormat));

In any case at present every image is saved as phpThumb_generated_thumbnail.jpg which is less than helpful.

Personally I would use something like Original_file_name-400x300.jpg ... could such options be added?

JamesHeinrich commented 6 years ago

Please try https://github.com/JamesHeinrich/phpThumb/commit/09ebb183d0920b8453b8d02213b9e25c71eb6bb0 and let me know if that works better for you?

badbadmonkey commented 6 years ago

Works great for me!

I wonder if there might be some defaults surfaced in config. E.g. which elements do you want shown in the sia name - or, for the paranoid, none at all.

JamesHeinrich commented 6 years ago

The paranoid are still free to supply their own download override name, of course.