easy way to acquire height / width from images (PNG, JPEG) stored asbytea? - Mailing list pgsql-general

From Achilleas Mantzios
Subject easy way to acquire height / width from images (PNG, JPEG) stored asbytea?
Date
Msg-id 03a79221-6e00-4d8e-c6bc-c01cadb352d9@matrix.gatewaynet.com
Whole thread Raw
Responses Re: easy way to acquire height / width from images (PNG, JPEG) storedas bytea?
Re: easy way to acquire height / width from images (PNG, JPEG) storedas bytea?
List pgsql-general
Hello Dear List,

we have a table holding email attachments as bytea, and we would like to 
filter out images of small dimensions, which are not of any value to our 
logic.

I took a look at pg_image extension, tested it, and it proved 
problematic, it killed my 200+ days uptime FreeBSD box :( . I dropped 
the extension and uninstalled this as soon as fsck finally finished.

So I would like to ask you, basically we have PNGs and JPEGs, is there 
an easy way of parsing their headers and getting info about their 
dimensions?

I could write a C function for that. For PNG it is quite easy but for 
JPEG it gets a little bit complicated, albeit doable, just asking for 
something out of the box. Currently we load images (in our java 
enterprise system) and filter them in Java, but this brings wildfly down 
to its knees pretty easy and quickly.


Thank you and happy Easter.




pgsql-general by date:

Previous
From: David Rowley
Date:
Subject: Re: Is there a script and sample data to test the performance of postgresql?
Next
From: Adam Brusselback
Date:
Subject: Re: easy way to acquire height / width from images (PNG, JPEG) storedas bytea?