pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Achilleas Mantzios <achill@matrix.gatewaynet.com>
To: pgsql-general@lists.postgresql.org
To: itdev@gatewaynet.com
Subject: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?
Date: Fri, 17 Apr 2020 15:37:22 +0300
Message-ID: <03a79221-6e00-4d8e-c6bc-c01cadb352d9@matrix.gatewaynet.com> (raw)

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.






view thread (7+ messages)  latest in thread

Message-ID: <03a79221-6e00-4d8e-c6bc-c01cadb352d9@matrix.gatewaynet.com>
Permalink:  ../03a79221-6e00-4d8e-c6bc-c01cadb352d9@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/03a79221-6e00-4d8e-c6bc-c01cadb352d9@matrix.gatewaynet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: achill@matrix.gatewaynet.com, itdev@gatewaynet.com
  Subject: Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?
  In-Reply-To: <03a79221-6e00-4d8e-c6bc-c01cadb352d9@matrix.gatewaynet.com>
  References: <03a79221-6e00-4d8e-c6bc-c01cadb352d9@matrix.gatewaynet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox