Flex image - processed images generation

hi, guys,

I have been researching on an image uploader plugin to use for my application.

I have my eyes of fleximage at the moment.

One of the links I read was http://github.com/Squeegy/fleximage.

Pretty neat I must say.

I just have some questions:

1) Seems to be that thumbnails generation and rendering of images (ie uploaded images get applied with watermarks) happen dynamically (ie. the watermarked thumbnails are generated when a request is made).    Sorry, looked at the source code for Resize and it seems to be the case.    Can anyone confirm that this is the case?

2) Has anyone used FlexImage in their production environment and can comment if dynamically generating images would take up the server's available resources (ie. memory footprint)?

3) Has anyone got another plugin to recommend that would satisfy the following criteria?   - can resize thumbnails to different sizes (ie, small, medium, large)?   - can apply watermarks to uploaded images?   - images can be stored in either database or file system ( allows future expansion or swap from one storage method to another)

thank you

I have been researching on an image uploader plugin to use for my application.

I have my eyes of fleximage at the moment.

One of the links I read was GitHub - AlexJWayne/fleximage: Rails plugin for uploading images as resources, with support for resizing, text stamping, and other special effects..

Pretty neat I must say.

I just have some questions:

1) Seems to be that thumbnails generation and rendering of images (ie uploaded images get applied with watermarks) happen dynamically (ie. the watermarked thumbnails are generated when a request is made).   Sorry, looked at the source code for Resize and it seems to be the case.   Can anyone confirm that this is the case?

This is true. But you can cache the result to disk using Rails
caches_page... Long ago I had this in one of my controllers:

class HomeController < ApplicationController

   caches_page :photo, :thumb

   flex_image :action => 'photo',               :class => Photo,               :quality => 95,               :shadow => {                 :color => '#000',                 :background => '#fff',                 :blur => 4,                 :offset => '2x2',                 :opacity => 0.75               },               :overlay => {                 :file => 'public/images/watermark.png',                 :alignment => :bottom_right,                 :offset => 0               }

    # there was a thumb one too, but have removed it to save room. end

If you go to the url below the thumbnails are generated (and cached)
using the above code and if you click on the image you'll see the
larger version with watermark.

http://overthefencecards.com/our_products/package/13-mosaics-collection-6-cards

2) Has anyone used FlexImage in their production environment and can comment if dynamically generating images would take up the server's available resources (ie. memory footprint)?

They will take up RAM when being generated. If you cache them they
will take up disk space, but after that are like any other image.

3) Has anyone got another plugin to recommend that would satisfy the following criteria? - can resize thumbnails to different sizes (ie, small, medium, large)? - can apply watermarks to uploaded images? - images can be stored in either database or file system ( allows future expansion or swap from one storage method to another)

paperclip can do this I think. I know it can resize and if you google
I'm sure someone has instructions on how to set it up to watermark the
images (it uses ImageMagick underneath which can watermark so should
be doable). Images can be stored in the filesystem or on S3. Not
sure about in a database (just never paid attention to that part).

guys, I am using paperclip and have been prettyhappy with it.

One thing though is that if I were to specify my image dimensions for landscape images (ie. 600x400, 800x600, 1024x768 and so forth), uploading pictures which are portrait (ie. 400x600, 600x800, 768x1024 and so forth) would cause cropping and streching (undesired).

When using ImageMagicK with perl (via PerlMagick), I used to detect if

height, then it is a landscape and I will resize by means of

width x height. Otherwise, being portrait, I would resize by means of height x weight.

I might have a closer look at this tonight but any ideas of how to overcome this problem in Rails?

thanks :slight_smile:

gordon