size of image in LocalFS
Hi, I have a set of images in a LocalFS. I provide links to those images on another page and when a user clicks on those links a small window pops up that displays the image. Is it possible in anyway to figure out the size of the image in advance so that I can size the pop up window to be the same?? TIA AM -- ================================================================== Aseem Mohanty Neurobehavioral Systems Inc, 828 San Pablo Ave, Albany, CA 94706 (R) 510 7696011 (M) 510 3014871 (O) 510 5279231 ================================================================== "I saw `cout' being shifted "Hello world" times to the left and stopped right there!!" -- Steve Gonedes ==================================================================
AM wrote:
Hi, I have a set of images in a LocalFS. I provide links to those images on another page and when a user clicks on those links a small window pops up that displays the image. Is it possible in anyway to figure out the size of the image in advance so that I can size the pop up window to be the same??
untested: from OFS.Image import getImageInfo # you can probably get the data in another way via localFS f = open('path/to/image.jpg') data = f.read() f.close() content_type, width, height = getImageInfo(data) regards Max M
participants (2)
-
AM -
maxm