photo manipulation in Studio 6.1 and/or Postgres

Andrew Stolarz stolarz at gmail.com
Tue Feb 14 14:33:07 EST 2017


Hi Jim,

As Clifford pointed out, its best to store the image outside the database
and just store the relative paths to images in your data if you will have
growing number of images.

For our web app, we store all images in Amazon S3, we use ImageMagick to do
most image based conversions on Ec2...... we have done hundreds of
thousands of conversions....if not in the millions. ImageMagick is a pretty
solid tool once setup.


For our thick client app, we store all images/files on a server and
retrieve it as needed. Works great.


To answer you question, It might be quickest to write a python script (tons
of info online) with ImageMagick and do the conversions to smaller sizes.



Andrew


On 14 February 2017 at 14:04, CLIFFORD ILKAY <clifford_ilkay at dinamis.com>
wrote:

> On 14/02/17 09:27 AM, Jim Pistrang wrote:
>
>> Hi all,
>>
>> I'm storing some photos as binary data in a Postgres database.  The
>> column is defined as a PICTURE in the Omnis schema, and the user
>> inserts/updates by pasting a photo into a picture field (kPictureObject) in
>> an Omnis window.  I can check the size of the pasted picture with the
>> binlength() function and not do an insert or update if the image is too
>> large.
>>
>> My immediate problem:  I haven't been checking the size up till now, and
>> there are about 500 photos already in the database that are really big (8mb
>> or so).  Is there a way in Omnis (or with some other tool) that I can fetch
>> an image, reduce its size, and then update postgres?
>>
>> Thanks from snowy New England,
>>
>> Jim
>>
>>
> Hi Jim,
>
> I think you use OS X. If so, "batch resize image" yielded this: <
> http://osxdaily.com/2013/01/16/batch-image-conversion-mac-os-x-preview/>.
> I haven't used it. I have used ImageMagick and Photoshop to batch resize
> and both worked well.
>
> You're underscoring why I never store images in the database. I store a
> relative file path and set the base path as a config option. I store the
> highest resolution and then transform the images on the fly, as necessary.
> It's rare that I'll need just one size of an image.
>
> --
> Regards,
>
> Clifford Ilkay
>
> + 1 647-778-8696
>
>
>
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
>



More information about the omnisdev-en mailing list