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
Cc: itdev@gatewaynet.com
Subject: Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?
Date: Fri, 17 Apr 2020 17:39:11 +0300
Message-ID: <96fadd6d-d7f9-4365-d008-6ba25233c867@matrix.gatewaynet.com> (raw)
In-Reply-To: <CAMjNa7egZo+1H6ztc6OjyeKupkEaxO8ppRmoecj+=SwCNwQ5ng@mail.gmail.com>
References: <03a79221-6e00-4d8e-c6bc-c01cadb352d9@matrix.gatewaynet.com>
	<CAMjNa7egZo+1H6ztc6OjyeKupkEaxO8ppRmoecj+=SwCNwQ5ng@mail.gmail.com>

On 17/4/20 4:09 μ.μ., Adam Brusselback wrote:

> Why not extract and store that metadata with the image rather than 
> trying to extract it to filter on at query time? That way you can 
> index your height and width columns to speed up that filtering if 
> necessary.
>
Yes I thought of that, but those are coming automatically from our mail 
server (via synonym), we have written an alias : a program that parses 
and stores emails. This is generic, I wouldn't like to add specific code 
(or specific columns)  just for image attachments. However I dig the 
idea of the indexes.
> You may be able to write a wrapper for a command line tool like 
> imagemagic or something so you can call that from a function to 
> determine the size if you did want to stick with extracting that at 
> query time.
As I describe above, those attachments are nowhere as files. They are 
email attachments. Also we got about half TB of them.

view thread (7+ messages)  latest in thread

Message-ID: <96fadd6d-d7f9-4365-d008-6ba25233c867@matrix.gatewaynet.com>
Permalink:  ../96fadd6d-d7f9-4365-d008-6ba25233c867@matrix.gatewaynet.com/
Also on:    postgresql.org/message-id/96fadd6d-d7f9-4365-d008-6ba25233c867@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: <96fadd6d-d7f9-4365-d008-6ba25233c867@matrix.gatewaynet.com>
  References: <03a79221-6e00-4d8e-c6bc-c01cadb352d9@matrix.gatewaynet.com> <CAMjNa7egZo+1H6ztc6OjyeKupkEaxO8ppRmoecj+=SwCNwQ5ng@mail.gmail.com> <96fadd6d-d7f9-4365-d008-6ba25233c867@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