Get image height/width from attachment table

kelvin_du
Giga Contributor

Hi guys,

Can I get image height/width from attachment table? Or is there any way to get that by server script?

Thanks

1 ACCEPTED SOLUTION

HungMiju
Mega Expert

Hi Kelvin,



Please add that image to "System UI -> Images" first
then you can get Height/Width.


View solution in original post

4 REPLIES 4

bernyalvarado
Mega Sage

Height and width are available in the image table: db_image table. Would that work for you?




Thanks,


Berny


Or you can also use the solution shared here based on the bytes column available in the sys_attachment table



java - Extract image's width, height, color and type from byte array - Stack Overflow



Thanks,


Berny


Thanks for you answer.
My specific problem is: I have a image field in my form. I upload the image for that field, it's stored in sys_attachment table but it doesn't exist in db_image table. So I still can't get the height or width.


HungMiju
Mega Expert

Hi Kelvin,



Please add that image to "System UI -> Images" first
then you can get Height/Width.