Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?

From: Adam Brusselback <adambrusselback(at)gmail(dot)com>
To: Achilleas Mantzios <achill(at)matrix(dot)gatewaynet(dot)com>
Cc: pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>, itdev(at)gatewaynet(dot)com
Subject: Re: easy way to acquire height / width from images (PNG, JPEG) stored as bytea?
Date: 2020-04-17 13:09:09
Message-ID: CAMjNa7egZo+1H6ztc6OjyeKupkEaxO8ppRmoecj+=SwCNwQ5ng@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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.

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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ted Toth 2020-04-17 13:28:07 Re: performance of first exec of prepared statement
Previous Message Achilleas Mantzios 2020-04-17 12:37:22 easy way to acquire height / width from images (PNG, JPEG) stored as bytea?