![]() |
|
Display Image Dimensions and File Size - Printable Version +- ZenphotoCMS Forum (https://forum.zenphoto.org) +-- Forum: Support (https://forum.zenphoto.org/forum-1.html) +--- Forum: General support (https://forum.zenphoto.org/forum-4.html) +--- Thread: Display Image Dimensions and File Size (/thread-13214.html) |
Display Image Dimensions and File Size - KimberTLE - 2019-03-20 I don't seem to find a setting to display the image dimensions and file size along with the image. [In fact, it would be even better if I could get it displayed ON the image as an overlay]. What am I missing? Display Image Dimensions and File Size - KimberTLE - 2019-03-21 OK. [u]I DO NOT[/u] program in Php. But I did take a look at the code for the Zenpage theme and ZP. After a few Google searches looking for Php syntax, on line 106 of the file image.php, I made the following code change: That gets me the full image width and height when I'm viewing the full image. It relies on printImageDesc() using the current image being viewed when nothing (null) has been passed to it. I'm sure I can now figure out how to get the file size. But this only solves my problem for the Zenpage template. It seems ludicrous that 15 year old software exists and absolutely nobody has ever wanted to display the image dimensions and sizes. There [u]must[/u] be a better way!!! Someone, please... enlighten me! Display Image Dimensions and File Size - acrylian - 2019-03-21
If you like to modify more default behaviour of existing themes there will be no way around this as you probably already realized (plus knowledge in HTML, CSS and JS may not hurt) Ready made themes are always suggestion to use and to adapt if you want/need anything different. They cannot fit for everyone. We have theming tutorial that covers the basics of theming: Zenphoto theming is quite flexible but "exploiting" that requires naturally some knowledge.
No, it relies on the image context that is set on The optional parameter of
You already figured out the right way to display the size of the original image. For the size that is really nothing Zenphoto specific as plain PHP functions exist for that:
http://php.net/manual/en/function.filesize.php Display Image Dimensions and File Size - KimberTLE - 2019-03-23 acrylian: Sorry. I should have said "OK. I DO NOT program in Php, but I have 46 years of professional experience in programming, including 28 different programming languages ... plus a few languages I've never used professionally. My favorite language is Perl" Thanks for your reply. Guess I'll have to live with making manual modifications, eh? BTW: For me, getFullImageURL() returns "images[5]" and not the file size. Display Image Dimensions and File Size - acrylian - 2019-03-23
Well, yes, the best is always to make your own custom theme to really cover your personal needs. You have a lot freedom to do what you need which is one of the real strenghts of Zenphoto.
Do you perhaps have the full image set to protected on the options? Then try Display Image Dimensions and File Size - KimberTLE - 2019-03-25 acrylian: thanks for your reply and suggestion! Under: Admin->Options->Images The option for "Full image protection" was set to: 'download.' I changed it to 'Unprotected' as per your suggestion. I changed line 106 of image.php in the Zenpage theme to read (NOTE: I've reformatted the code below for ease of reading - it's actually one long line in the real image.php file!): [/code] $filesize prints nothing visible on the screen. Display Image Dimensions and File Size - acrylian - 2019-03-25 You are right, my bad. I always forget that "getFullImageURL()" returns a webpath url for theme usage and that This works:
It will put out bytes so a quite huge number. You can use I guess I will indeed consider to add a helper function Addition: This is much shorter (there are most always several ways). Btw, the next version wil have said function and the support build already does. |