Need to store image size in DB

Phoca Gallery - image gallery extension
User avatar
Matysh
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 17 Jan 2017, 15:20

Need to store image size in DB

Post 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.
User avatar
KarEm
Phoca Professional
Phoca Professional
Posts: 154
Joined: 20 Dec 2015, 21:25

Re: Need to store image size in DB

Post by KarEm »

Hi,
just out of interest, for what purpose do you need, I suspect the values of the thumbs?

Regards
KarEm
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Need to store image size in DB

Post 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
If you find Phoca extensions useful, please support the project
User avatar
Matysh
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 17 Jan 2017, 15:20

Re: Need to store image size in DB

Post 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.
User avatar
Matysh
Phoca Newbie
Phoca Newbie
Posts: 5
Joined: 17 Jan 2017, 15:20

Re: Need to store image size in DB

Post 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.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 47810
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Need to store image size in DB

Post by Jan »

Ok, maybe the images were added on your server before the function to store these values was introduced. :idea:

Jan
If you find Phoca extensions useful, please support the project
Post Reply