Page 1 of 1

Need to store image size in DB

Posted: 16 Oct 2019, 08:45
by Matysh
Hi!
I use phoca gallery component several years and it is awesome! Thanks!
I display the gallery on my website (example) with jquery mosaic - it is cool plugin to display gallery. But I need to know width and height for every image. Now, I take it with with getimagesize, but I think that it is non optimal way. Can we store width and height for every image in DB? May be you can do it with next update, I hope it is fast and easy, but useful feature.

Re: Need to store image size in DB

Posted: 16 Oct 2019, 13:48
by KarEm
Hi,
just out of interest, for what purpose do you need, I suspect the values of the thumbs?

Regards
KarEm

Re: Need to store image size in DB

Posted: 16 Oct 2019, 13:57
by Jan
Another question, which size you need to know - size of the thumbnail or size of the original image?

The size of thumbnail is stored in database in columns: extw, exth:

Image

where the ordering is large thumbnail, medium thumbnail, small thumbnail

Re: Need to store image size in DB

Posted: 16 Oct 2019, 14:05
by Matysh
KarEm
1. For mosaic plugin (there is enough aspect ratio, so we need width and height to calculate it. In fact, size of thumbnails enough for it)
2. For photoswipe plugin we need attribute data-sizes for correct scaling.
It is only my reasons, I think there are many other cases for any big and complex website. F.e. to display original sizes for users.

Jan
I talk about size of original images.

Re: Need to store image size in DB

Posted: 16 Oct 2019, 14:13
by Matysh
Jan
I don't know why, but for most images in my DB fields 'extw' and 'exth' is empty o_O.
I'm always add new images via Multiple add.

Update:
This fields stay filled after "recreate thumbnails" for this image.

Re: Need to store image size in DB

Posted: 21 Oct 2019, 15:52
by Jan
Ok, maybe the images were added on your server before the function to store these values was introduced. :idea:

Jan