Skip to main content
August 4, 2007
Question

thumbnail generation

  • August 4, 2007
  • 4 replies
  • 274 views
hello, I have a gallery of images. When a user submits a search query, I want Coldfusion MX7 to generate a low-res thumbnail gallery from tha database of high-res images.
What is the best way to do this ?

thanks kindly for any help
    This topic has been closed for replies.

    4 replies

    Inspiring
    August 5, 2007
    phil1943 wrote:
    > thanks for that, but I was wanting to dynamically create resampled thumbails
    > (smaller file size) rather than simply adjusting the display dimensions.

    and where in my post did i say that imagecfc or another 3rd party image
    manipulation utility will only resize the display size of the image?
    did you even look at imageCFC and what it does?

    if you misunderstood what i have said - let me rephrase:

    if you are not using the latest version of cf which has a built-in
    <cfimage> tag, you must use a 3rd part tool like imageCFC to create
    thumbnails (=resampled/resized copies of your images as separate files;
    NOT just shrunk display of your large images)

    NOTE: imageCFC (and most other such tools) can also do a lot more that
    just create thumbnails.

    in general, you should create scaled-down thumbnails at image upload
    time, NOT at display time; if nothing else, this will at least reduce
    the response rendering time.

    > It would also be nice if these were temporary ie. after user clicks on
    > dynamically generated thumbnail, the thumbnail file is deleted from server.

    now that is a terrible idea. seriously. trust me - you do not want to be
    doing that. see Kapitaine's post.


    ---
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com
    August 5, 2007
    There's no point creating a thumbnail then deleting it again. Imagine if you had just a 100 users at least - this would hammer your server significantly if it had to resize an image on every request. It gets a lot worse when you have even more users I'm sure.

    The best thing to do is to create a resize of the image the user is submitting at the moment of upload. In CF8 this can be done dynamically using cfimage tag and in previous versions you will have to use a third party function or custom tag,

    Each of these methods will create a proper thumbnail version, and you can set certain variables such as aspect ratio, color, quality etc etc.
    August 5, 2007
    thanks for that, but I was wanting to dynamically create resampled thumbails (smaller file size) rather than simply adjusting the display dimensions.
    It would also be nice if these were temporary ie. after user clicks on dynamically generated thumbnail, the thumbnail file is deleted from server.

    Does anyone know of anything I can use ?
    Inspiring
    August 5, 2007
    cf mx 7 can't do it by itself - you will need to use a third-party tool.
    i like the free imageCFC which you can find at
    http://www.opensourcecf.com/imagecfc/

    with the new cf8 i think you can do it with the built-in <cfimage> tag

    on a general note, i would suggest creating thumbnails at the high-res
    image uploading time instead of at user's search request time.

    ---
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com