Page 1 of 1

More to generating thumb name than this?

Posted: Sat Feb 26, 2011 2:28 am
by FishNiX
Will the thumbname always be

Code: Select all

$basename . "." . $serendipity['thumbSuffix'] . "." . $extension
ie.
If I have a foobar-someimagefile.jpg -- will the thumb always be foobar-someimagefile.$serendipity['thumbSuffix'].jpg or will there be truncation, etc?

I'm trying to determine the thumbnail name in a plugin.

Thanks!

Re: More to generating thumb name than this?

Posted: Sat Feb 26, 2011 4:04 am
by FishNiX
I guess I should be more clear -- basename is the full name of the image assigned in the media upload without the extension passed in through eventData -- my plugin is working off of the backend_image_add event hook and I want to get the thumb name reliably. thx!

Re: More to generating thumb name than this?

Posted: Sat Feb 26, 2011 9:20 am
by Timbalu
FishNiX wrote:Will the thumbname always be foobar-someimagefile.$serendipity['thumbSuffix'].jpg or will there be truncation, etc?
I would say yes, but this question has to wait for an answer by Garvin, to have higher trust.
But I know that $serendipity['thumbSuffix'] is not build in every case, just if there is a need, by size and/or if file is a picture.The Admin Panel / General settings / Image Conversion Settings does set the $serendipity['thumbSuffix'] name eg. picturename.serendipityThumb.jpg.

Re: More to generating thumb name than this?

Posted: Sat Feb 26, 2011 3:54 pm
by FishNiX
Garvin confirmed that this should be all there is to generating a thumb name reliably. Thanks to both of you.