Skip to main content
Karen_Little
Inspiring
June 5, 2010
Question

Image Resize in CF 8

  • June 5, 2010
  • 1 reply
  • 1996 views

I'm working in CF 8. My issue is that my image cannot be taller than T nor wider than W.

I assume that I need to perform a number of tests on the uploaded image's height and width to come up with the optimum size, then plug those two measurements in pixels into Image Resize.

In other words, if the image is taller than T, reduce W by a related %. If the new width is still wider than the required W, reduce the width accordingly, then reduce the height by a related %. When done, plug those two numbers into Image Resize.

Is there any other way to do this, or is my interpretation of the required steps correct?

Thanks, Karen

This topic has been closed for replies.

1 reply

Known Participant
June 5, 2010

Use CFX_OpenImage. I use it all the time for Resizing, Cropping and Rotating on the fly - it is fast and very flexible. You'll have to Google it. It was written, I believe, by somone in Finland. If you can't find it let me know and I'll email it to you.

Ted Daniels (ted_daniels@hotmail.com)

Karen_Little
Inspiring
June 5, 2010

Ted, I'll look that up. Note that I was successfully using an image manipulation program  written by www.masrizal.com which worked like a champ until CF was upgraded to version 8.

So now I am writing my own routine, which, as of 2PM today, I more or less successfully did.

Where I do not think I'm successful is this - please advise:

I need to rename my file and end that renamed file with a file extension. Right now, I am forcing that extension to be ".jpg".

I believe that what I really need to do is figure out what type of image file was uploaded and if not a .jpg, convert it to a .jpg, or use the same file extension.

In CF8's documentation, I see a reference to image file convert, but its paramaters make no sense.

The online docs don't appear to address the issue of evaluating what type of image was uploaded and what type of image that has to be converted to.

If anyone could shed light on this, I'd be most greatful.

Karen

Known Participant
June 5, 2010

Karen:

Try the CFX_OpenImage first (Its free) - I don't recall all its functionality, just know what I use it for. I originally tried but it was dreadfully slow compared with CFX_OpenImage.

I'm just doing some programming to store images directly into an SQL database - stupid idea, but I have to convert a large database with neat ideas into another large database filled with stupid ideas, storing images directly in an Image Field being one of them.

Not only was it a stupid idea they had, but they were betting I couldn't do it because I store all my images in directories and just store the path in the database. Well, just took 2 hrs to figure it out this morning - ha ha

Anyway, I'll look at your stuff later today after I have polished up what I am doing now.

Ted

Date: Sat, 5 Jun 2010 12:08:52 -0600

From: forums@adobe.com

To: ted_daniels@hotmail.com

Subject: Image Resize in CF 8

Ted, I'll look that up. Note that I was successfully using an image manipulation program written by http://www.masrizal.com which worked like a champ until CF was upgraded to version 8.

So now I am writing my own routine, which, as of 2PM today, I more or less successfully did.

Where I do not think I'm successful is this - please advise:

I need to rename my file and end that renamed file with a file extension. Right now, I am forcing that extension to be ".jpg".

I believe that what I really need to do is figure out what type of image file was uploaded and if not a .jpg, convert it to a .jpg, or use the same file extension.

In CF8's documentation, I see a reference to image file convert, but its paramaters make no sense.

The online docs don't appear to address the issue of evaluating what type of image was uploaded and what type of image that has to be converted to.

If anyone could shed light on this, I'd be most greatful.

Karen

>