House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

image manipulation in coldfusion?

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Andy Matthews wrote:
Rick Root
10/04/05 04:03 P
ImageCR3:
cftalk
10/04/05 06:08 P
now i'm torn.
Charlie Griefer
10/04/05 06:15 P
> now i'm torn.
Bryan Stevenson
10/04/05 06:22 P
Wow... yeah...
Alan Rother
10/04/05 07:42 P
Bryan...
Andy Matthews
10/05/05 09:33 A
Sorry Bryan ;)
Emmet McGovern
10/05/05 12:41 P
Bryan,
Burns, John D
10/05/05 12:11 P
Hey John,
Bryan Stevenson
10/05/05 12:16 P
> That's what I tried to do when
Roger B.
10/07/05 12:25 A
> > That's what I tried to do when
Massimo Foti
10/10/05 05:27 A
Bryan,
Burns, John D
10/05/05 12:17 P
I'm catching up on this thread, but ...
Webmaster at FastTrack On Line
10/10/05 09:17 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
10/04/2005 03:49 PM

So I'm wondering what some of you use to manipulate images in CF. I've been wanting something like this for a while but it's always gotten put off. At the very least I need to be able to resize images and get their height and width. More than that would be nice, but not necessary. Can anyone offer any suggestions? <!----------------//------ andy matthews web developer ICGLink, Inc. andy@icglink.com 615.370.1530 x737 --------------//--------->

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Charlie Griefer
10/04/2005 03:55 PM

not free, but i'd highly recommend the alagad image component. http://www.alagad.com/ ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan Stevenson
10/04/2005 03:58 PM

search the archives for my name or e-mail and "ThumbIt" or mabye "image manipulation".  I've posted my CFC methods that use Java to resize images and get image pixel height/width about 5-10 times now....does not work with TIFFs I don't have the code handy right now or I'd post it yet again ;-) Cheers Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rick Root
10/04/2005 04:03 PM

Andy Matthews wrote: > So I'm wondering what some of you use to manipulate images in CF. I've been > wanting something like this for a while but it's always gotten put off. > > At the very least I need to be able to resize images and get their height > and width. More than that would be nice, but not necessary. I use built in java stuff to do this with jpegs .. take a look at the image.cfc file included in the CFFM distributino (www.webworksllc.com/cffm) rick

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joe Rinehart
10/04/2005 04:07 PM

I'd check out the Alagad Image Component at www.alagad.com - it's native CF.  While it's not free, it's so cheap that you'll make back the dough the first time you use it in terms of time saved. -Joe ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Raymond Camden
10/04/2005 05:51 PM

I'll ditto Alagad. It's only like 75 bucks and well worth the price. Yes, there are free alternatives, but this one is so easy and simple to use, I'd still recommend it. ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
cftalk
10/04/2005 06:08 PM

ImageCR3:   http://efflare.com/products/cfx_imagecr/ Personal licenses for $75:   http://efflare.com/purchase/?personal We never gave it away for free, but we have plenty of happy customers. It is optimized native code, like important parts of Java. High quality output and extensive image format support. If CF user groups want a license, send me a mail. -- CrystalM ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Charlie Griefer
10/04/2005 06:15 PM

now i'm torn. I've used ImageCR3 in the past and yes, it's a great product with absolutely fantastic (FANTASTIC) support. But what I like about Alagad is the fact that it's a straight CFC.  No custom tags to install (which may not be a big issue unless you're in a shared environment and the host likes to charge for custom tag installations). On 10/4/05, cftalk@efflare.com <cftalk@efflare.com> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan Stevenson
10/04/2005 06:22 PM

----- Excess quoted text cut - see Original Post for more ----- Charlie...buddy....find my code in the archives...straight CFC...and FREE...I can only try and help so much!! ;-) Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Alan Rother
10/04/2005 07:42 PM

Wow... yeah... Alagad is nice, but the stuff from eFFlare is awesome. If you are in a shared envirnment I would go with alagad. ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
kola.oyedeji
10/05/2005 08:58 AM

+3 I have used imageCR3 and the quality is awesome, that said as others have pointed out it does require a dll/cfx to be installed Kola ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Tim Laureska
10/05/2005 09:09 AM

Anyone have imageCR3 setup on a shared hosting environment? +3 I have used imageCR3 and the quality is awesome, that said as others have pointed out it does require a dll/cfx to be installed Kola ----- Excess quoted text cut - see Original Post for more ----- No > > custom tags to install (which may not be a big issue unless you're in ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
kola.oyedeji
10/05/2005 09:19 AM

That is the question :) if your host is happy to install it then its not a problem , if he is or you are on Linux then you will probably better off using one of the free alternatives such as Bryan's (some one was listening ;-)) or the Alagad image component which I've also heard great things about. Kola HTH ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Emmet McGovern
10/04/2005 07:43 PM

We use imageCR3 and love it.  I only wish it was java based so we could use it on linux. -e now i'm torn. I've used ImageCR3 in the past and yes, it's a great product with absolutely fantastic (FANTASTIC) support. But what I like about Alagad is the fact that it's a straight CFC.  No custom tags to install (which may not be a big issue unless you're in a shared environment and the host likes to charge for custom tag installations). On 10/4/05, cftalk@efflare.com <cftalk@efflare.com> wrote: ----- Excess quoted text cut - see Original Post for more ----- been > > wanting something like this for a while but it's always gotten put off. > > > > At the very least I need to be able to resize images and get their height ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan Stevenson
10/04/2005 08:03 PM

> We use imageCR3 and love it.  I only wish it was java based so we could > use > it on linux. > > -e Once again....my code is Java based and FREE (not as sophisticated as imageCR3....but original poster doesn't need the fancy stuff) OK...I'm done talking to myself ;-) Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pete Ruckelshaus
10/04/2005 10:35 PM

I use Massimo's tmt_img 2.0 (http://www.olimpo.ch/tmt/cfc/tmt_img/) and it's great if what you need to do is crp/resize images.  It's all CFC so no custom tags, nothing to configure.  Oh, and it's free. I extended it to add a "max size" that resizes so that no dimension is greater than the passed in value, which makes it even more invaluable for me. Pete

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
10/05/2005 09:33 AM

Bryan... The HoF site is down. Care to share that code via email or a straight link? <!----------------//------ andy matthews web developer ICGLink, Inc. andy@icglink.com 615.370.1530 x737 --------------//---------> > We use imageCR3 and love it.  I only wish it was java based so we could > use > it on linux. > > -e Once again....my code is Java based and FREE (not as sophisticated as imageCR3....but original poster doesn't need the fancy stuff) OK...I'm done talking to myself ;-) Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Emmet McGovern
10/05/2005 12:41 PM

Sorry Bryan ;) I've checked out your code.  It's great.  We just use ImageCR for the broad filetype support. -e > We use imageCR3 and love it.  I only wish it was java based so we could > use > it on linux. > > -e Once again....my code is Java based and FREE (not as sophisticated as imageCR3....but original poster doesn't need the fancy stuff) OK...I'm done talking to myself ;-) Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan Stevenson
10/05/2005 12:45 PM

> I've checked out your code.  It's great.  We just use ImageCR for the > broad > filetype support. yep...mine is great for good old JPG/GIF manip....but when ya hit the TIFFs it gets fuzzy....BTW I do have some code to convert multi-page TIFFs to PDF (one page per page in TIFF)....compliments of the wonderous package iText ;-) Cheers Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Matthew Small
10/05/2005 08:43 AM

Yes, yes, yes - use ImageCR3 if you have the chance.  I was going to recommend it myself.  I'm sure I haven't seen them all, but ImageCR3 looks FAR better than any other resizing tag out there.  I don't know how they do it, but they do it well. Matthew Small Web Developer American City Business Journals 704-973-1045 msmall@amcity.com ImageCR3:   http://efflare.com/products/cfx_imagecr/ Personal licenses for $75:   http://efflare.com/purchase/?personal We never gave it away for free, but we have plenty of happy customers. It is optimized native code, like important parts of Java. High quality output and extensive image format support. If CF user groups want a license, send me a mail. -- CrystalM > So I'm wondering what some of you use to manipulate images in CF. I've been ----- Excess quoted text cut - see Original Post for more -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Burns, John D
10/05/2005 11:09 AM

If there a difference in quality or control in the personal version vs. the full version? Or just the license? I'm only looking at using this for a personal site right now but may expand it later. Is there a way to "upgrade" the license to the full version or would I just have to buy from scratch? John Burns Certified Advanced ColdFusion MX Developer Wyle Laboratories, Inc. | Web Developer ImageCR3:   http://efflare.com/products/cfx_imagecr/ Personal licenses for $75:   http://efflare.com/purchase/?personal We never gave it away for free, but we have plenty of happy customers. It is optimized native code, like important parts of Java. High quality output and extensive image format support. If CF user groups want a license, send me a mail. -- CrystalM > So I'm wondering what some of you use to manipulate images in CF. I've > been wanting something like this for a while but it's always gotten put off. ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
cftalk
10/05/2005 11:25 AM

The personal/non-commercial "version" differs only by license. You get the same download and binary as commercial customers. You can upgrade to a commercial license for the difference in cost between these license types. The same upgrade policy applies for upgrades to future versions of ImageCR, eg. ImageCR4. -- CrystalM ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan Stevenson
10/05/2005 11:38 AM

....and for those that care (Tony got his offlist)....here's the FREE code I was on about yesterday.....enjoy!!   <!---(Function: ThumbIt)------------------------------------------------------   Date Created:   December 1, 2003   Author:         Bryan   Arguments:      FileLoc - full path of image to be thumbnailed (string) required                   ThumbPrefix - string to append to the filename to name the thumbnail (string) not required                   ScaleBy - which dimension to scale by "W or H" (string) required                   ScaleValue - the measurement of the dimension specified in ScaleBy to use to calculate proper scale (string) required   Purpose:        shrink an image   Returns:        N/A   --->   <cffunction name="ThumbIt" access="public">     <cfargument name="FileLoc" type="string" required="Yes">     <cfargument name="ThumbPrefix" type="string"required="No" default="">     <cfargument name="ScaleBy" type="string" required="Yes">     <cfargument name="ScaleValue" type="string"required="Yes">     <cfset jFileIn = createObject("java","java.io.File").init(ARGUMENTS.FileLoc)>     <!--- build new file loc and name --->    <cfset DirPath = GetDirectoryFromPath(ARGUMENTS.FileLoc)>    <cfset FileName = GetFileFromPath(ARGUMENTS.FileLoc)>     <cfset ThumbFileLoc = DirPath & ARGUMENTS.ThumbPrefix & FileName>     <cfset jFileOut = createObject("java","java.io.File").init(ThumbFileLoc)>     <!--- set dimiensions --->     <cfset inBufferedImg = createObject("java","javax.imageio.ImageIO").read(jFileIn)>     <cfset ImgWidth = inBufferedImg.getWidth()>     <cfset ImgHeight = inBufferedImg.getHeight()>   <!--- calculate scale --->     <cfif UCase(ARGUMENTS.ScaleBy) eq "W">     <cfset Scale = ARGUMENTS.ScaleValue / ImgWidth>     <cfelseif UCase(ARGUMENTS.ScaleBy) eq "H">       <cfset Scale = ARGUMENTS.ScaleValue / ImgHeight>     </cfif>   <!--- define thumbnail dimensions --->   <cfset ScaledWidth = (Scale * ImgWidth)>     <cfset ScaledHeight = (Scale * ImgHeight)>   <!--- create image output --->   <cfset outBufferedImg = createObject("java","java.awt.image.BufferedImage").init(JavaCast("int", ScaledWidth), JavaCast("int", ScaledHeight), JavaCast("int", 1))>   <!--- create the AffineTransform --->   <cfset jTransform = createObject("java","java.awt.geom.AffineTransform").init()>   <cfset temp = jTransform.Scale(Scale, Scale)>   <!--- initialize a Graphics2D object --->   <cfset jGraphics2D = outBufferedImg.createGraphics()>   <!--- draw the thumbnail --->   <cfset temp = jGraphics2D.drawRenderedImage(inBufferedImg, jTransform)>   <cfset temp = jGraphics2D.dispose()>   <!--- write the thumbnail image to disk --->   <cfset fileWritten = createObject("java","javax.imageio.ImageIO").write(outBufferedImg, "jpg", jFileOut)>   </cffunction>   <!---(Function: ImageSize)------------------------------------------------------   Date Created:   November 28, 2003   Author:         Bryan   Arguments:      FileLoc - full path of image to get details for (string) required   Purpose:        returns file width/height   Returns:        ImageInfo structure with ImgWidth/ImgHeight keys   --->   <cffunction name="ImageSize" returnType="struct" access="public">     <cfargument name="FileLoc" type="string" required="Yes">     <cfset jFileIn = createObject("java","java.io.File").init(ARGUMENTS.FileLoc)>     <cfset ImageInfo = StructNew()>     <cfset ImageObject = createObject("java","javax.imageio.ImageIO").read(jFileIn)>     <cfset ImageInfo.ImgWidth = ImageObject.getWidth()>     <cfset ImageInfo.ImgHeight = ImageObject.getHeight()>     <cfreturn ImageInfo>   </cffunction> Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Burns, John D
10/05/2005 12:11 PM

Bryan, How is the quality on the resizes for that? I've used some java stuff like that before and had issues with the quality. Things seemed to come out a little distorted. From what I can see in the component, it doesn't seem like there's any kind of argument for the quality. Let me know if you've had similar experiences. For some of the people I've tried doing this for, they're artists and bands and people who are a little more particular about the resize quality so I really need it to be top notch. Let me know. John Burns Certified Advanced ColdFusion MX Developer Wyle Laboratories, Inc. | Web Developer .....and for those that care (Tony got his offlist)....here's the FREE code I was on about yesterday.....enjoy!!   <!---(Function: ThumbIt)------------------------------------------------------   Date Created:   December 1, 2003   Author:         Bryan   Arguments:      FileLoc - full path of image to be thumbnailed (string) required                   ThumbPrefix - string to append to the filename to name the thumbnail (string) not required                   ScaleBy - which dimension to scale by "W or H" (string) required                   ScaleValue - the measurement of the dimension specified in ScaleBy to use to calculate proper scale (string) required   Purpose:        shrink an image   Returns:        N/A   --->   <cffunction name="ThumbIt" access="public">     <cfargument name="FileLoc" type="string" required="Yes">     <cfargument name="ThumbPrefix" type="string"required="No" default="">     <cfargument name="ScaleBy" type="string" required="Yes">     <cfargument name="ScaleValue" type="string"required="Yes">     <cfset jFileIn = createObject("java","java.io.File").init(ARGUMENTS.FileLoc)>     <!--- build new file loc and name --->    <cfset DirPath = GetDirectoryFromPath(ARGUMENTS.FileLoc)>    <cfset FileName = GetFileFromPath(ARGUMENTS.FileLoc)>     <cfset ThumbFileLoc = DirPath & ARGUMENTS.ThumbPrefix & FileName>     <cfset jFileOut = createObject("java","java.io.File").init(ThumbFileLoc)>     <!--- set dimiensions --->     <cfset inBufferedImg = createObject("java","javax.imageio.ImageIO").read(jFileIn)>     <cfset ImgWidth = inBufferedImg.getWidth()>     <cfset ImgHeight = inBufferedImg.getHeight()>   <!--- calculate scale --->     <cfif UCase(ARGUMENTS.ScaleBy) eq "W">     <cfset Scale = ARGUMENTS.ScaleValue / ImgWidth>     <cfelseif UCase(ARGUMENTS.ScaleBy) eq "H">       <cfset Scale = ARGUMENTS.ScaleValue / ImgHeight>     </cfif>   <!--- define thumbnail dimensions --->   <cfset ScaledWidth = (Scale * ImgWidth)>     <cfset ScaledHeight = (Scale * ImgHeight)>   <!--- create image output --->   <cfset outBufferedImg = createObject("java","java.awt.image.BufferedImage").init(JavaCast("int", ScaledWidth), JavaCast("int", ScaledHeight), JavaCast("int", 1))>   <!--- create the AffineTransform --->   <cfset jTransform = createObject("java","java.awt.geom.AffineTransform").init()>   <cfset temp = jTransform.Scale(Scale, Scale)>   <!--- initialize a Graphics2D object --->   <cfset jGraphics2D = outBufferedImg.createGraphics()>   <!--- draw the thumbnail --->   <cfset temp = jGraphics2D.drawRenderedImage(inBufferedImg, jTransform)>   <cfset temp = jGraphics2D.dispose()>   <!--- write the thumbnail image to disk --->   <cfset fileWritten = createObject("java","javax.imageio.ImageIO").write(outBufferedImg, "jpg", jFileOut)>   </cffunction>   <!---(Function: ImageSize)------------------------------------------------------   Date Created:   November 28, 2003   Author:         Bryan   Arguments:      FileLoc - full path of image to get details for (string) required   Purpose:        returns file width/height   Returns:        ImageInfo structure with ImgWidth/ImgHeight keys   --->   <cffunction name="ImageSize" returnType="struct" access="public">     <cfargument name="FileLoc" type="string" required="Yes">     <cfset jFileIn = createObject("java","java.io.File").init(ARGUMENTS.FileLoc)>     <cfset ImageInfo = StructNew()>     <cfset ImageObject = createObject("java","javax.imageio.ImageIO").read(jFileIn)>     <cfset ImageInfo.ImgWidth = ImageObject.getWidth()>     <cfset ImageInfo.ImgHeight = ImageObject.getHeight()>     <cfreturn ImageInfo>   </cffunction> Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan Stevenson
10/05/2005 12:16 PM

Hey John, I haven't noticed any quality issues....also haven't used it with super high res images.... Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Massimo Foti
10/05/2005 12:17 PM

> How is the quality on the resizes for that? I've used some java stuff > like that before and had issues with the quality. You can use Java for image manipulation and achieve good quality results. You just have to dig the APIs a little more. That's what I tried to do when I wrote version 2.0 of my CFC and I achieved a huge increase in quality. You can get it from here and give it a try (it's free): http://www.olimpo.ch/tmt/cfc/tmt_img/ ---------------------------- Massimo Foti Tools for ColdFusion and Dreamweaver developers: http://www.massimocorner.com ----------------------------

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Roger B.
10/07/2005 12:25 AM

> That's what I tried to do when > I wrote version 2.0 of my CFC and I achieved a huge increase in quality. Massimo: Just to let you know... I was playing around with your CFC, and noticed that on some images (usually horizontally oriented ones), bufferedCrop() would throw an "outside of raster" error. I was able to fix it by modifying the code to check for crop operations that exceed the height of the image. With that said, thanks for putting the code out there. -- Roger Benningfield http://admin.support.journurl.com/ http://admin.mxblogspace.journurl.com/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Massimo Foti
10/10/2005 05:27 AM

----- Excess quoted text cut - see Original Post for more ----- Thanks Roger. I am aware of this but I am still not sure on what's the best way to handle it. Until now I tried to leave out any form of "logic" from the CFC; in my vision it only has to perform the basic operations, then it's up to the developer to wrap any logic around it (see the post about conditional cropping). The CFC could check if the crop area exceed image's dimensions and adjust the cropping area. I still have mixed feelings about this... It will surely make the CFC more "monkey proof", but I don't want a component that try to "outsmart" its user. Personally I would again, extend the CFC and add a "saveCrop" method that just wrap the logic around the base method. Feedback and opinions on this would be very much appreciated. ---------------------------- Massimo Foti Tools for ColdFusion and Dreamweaver developers: http://www.massimocorner.com ----------------------------

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Burns, John D
10/05/2005 12:17 PM

Bryan, How is the quality on the resizes for that? I've used some java stuff like that before and had issues with the quality. Things seemed to come out a little distorted. From what I can see in the component, it doesn't seem like there's any kind of argument for the quality. Let me know if you've had similar experiences. For some of the people I've tried doing this for, they're artists and bands and people who are a little more particular about the resize quality so I really need it to be top notch. Let me know. John Burns Certified Advanced ColdFusion MX Developer Wyle Laboratories, Inc. | Web Developer .....and for those that care (Tony got his offlist)....here's the FREE code I was on about yesterday.....enjoy!!

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Parker, Kevin
10/07/2005 12:50 AM

Thanks guys - I've been following this with interest as I have a particular resizing challenge at the moment. What I'm looking for is a way to test the size of an image before its displayed and then resize it if its width exceeds 250px - if 250px or less then it can be left alone. Not sure if tags like Massimo's support that or not. Any suggestions please. ++++++++++ Kevin Parker Web Services Consultant WorkCover Corporation p: 08 8233 2548 m: 0418 806 166 e: kparker@workcover.com w: www.workcover.com ++++++++++ > That's what I tried to do when > I wrote version 2.0 of my CFC and I achieved a huge increase in quality. Massimo: Just to let you know... I was playing around with your CFC, and noticed that on some images (usually horizontally oriented ones), bufferedCrop() would throw an "outside of raster" error. I was able to fix it by modifying the code to check for crop operations that exceed the height of the image. With that said, thanks for putting the code out there. -- Roger Benningfield http://admin.support.journurl.com/ http://admin.mxblogspace.journurl.com/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pete Ruckelshaus
10/07/2005 07:05 AM

It didn't, but I wrote an app on top of tmt_img that does it.  If you're interested in my code, shoot me an email.  I also extended tmt_img a bit. Pete

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
10/07/2005 09:19 AM

Put it out there Pete. I'd be interesting in seeing what else you added to it, There's a few things that I wish tmt_img did differently. All in all, it's a great piece of code though. Thank you Massimo. <!----------------//------ andy matthews web developer ICGLink, Inc. andy@icglink.com 615.370.1530 x737 --------------//---------> It didn't, but I wrote an app on top of tmt_img that does it.  If you're interested in my code, shoot me an email.  I also extended tmt_img a bit. Pete

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Pete Ruckelshaus
10/07/2005 04:26 PM

OK, most of the meat and potatoes of what I'm doing is in this cfscript block.  I'm sure that it's possible to encapsulate this in a much neater fashion, I just chose not to. <cfscript>   /* Set some variables that will make it easier to work with file and server paths */   filepath = cffile.serverdirectory & "\";   imgname = cffile.serverfile;   fullImgPath = filepath & imgname;   thumbname = cffile.serverfilename & "_thumb." & cffile.serverfileext;   fullThumbPath = filepath & thumbname;   /* Invoke the image CFC */   imgObj = CreateObject("component", "lib.cfc.tmt_img");      imgObj.getDimensions("#fullImgPath#");      /* Set image width and height as variables to make them easier to work with */   imgwidth = imgObj.getwidth("#fullImgPath#");   imgheight = imgObj.getheight("#fullImgPath#");      if (imgwidth GT imgheight) {     orientation = "landscape";   } else if (imgwidth LT imgheight) {     orientation = "portrait";   } else {     orientation = "square";   }      resizewidth = imgwidth;   resizethumbwidth = maxthumbdimension;   divide_by_value = (imgheight / imgwidth);      if ((imgwidth GTE maxdimension) AND (imgheight GTE maxdimension) AND (imgwidth GTE imgheight)) {     resizewidth = maxdimension;     resizethumbwidth = maxthumbdimension;     diagnostics = diagnostics & "Landscape, both dimensions larger than max.<br>";     resize = "true";   } else if ((imgwidth GTE maxdimension) AND (imgheight GTE maxdimension) AND (imgwidth LTE imgheight)) {     resizewidth = (maxdimension / divide_by_value);     resizewidth = round(resizewidth);     resizethumbwidth = (maxthumbdimension / divide_by_value);     resizethumbwidth = round(resizethumbwidth);     diagnostics = diagnostics & "Portrait, both dimensions larger than max.<br>";     resize = "true";   } else if ((imgwidth GTE maxdimension) AND (imgheight LTE maxdimension)) {     resizewidth = maxdimension;     resizethumbwidth = maxthumbdimension;     diagnostics = diagnostics & "Landscape, width greater than max, height less than max.<br>";     resize = "true";   } else if ((imgwidth LTE maxdimension) AND (imgheight GTE maxdimension)) {     resizewidth = (maxdimension / divide_by_value);     resizewidth = round(resizewidth);     resizethumbwidth = (maxthumbdimension / divide_by_value);     resizethumbwidth = round(resizethumbwidth);     diagnostics = diagnostics & "Portrait, width less than max, height greater than max.<br>";     resize = "true";   } else {     diagnostics = diagnostics & "Both dimensions smaller than max. [ELSE]<br>";     resize = "false";     /* Image is smaller than the maxdimension in both dimensions.       It won't resize the image, but what about sizing the thumbnail? */     if ((imgwidth GTE maxthumbdimension) AND (imgheight LTE maxthumbdimension)) {       /*  */       resizewidth = imgwidth;       resizethumbwidth = maxthumbdimension;       diagnostics = diagnostics & "Landscape, larger than thumbmax but smaller than max.<br>";       resize = "true";     } else if ((imgwidth LTE maxthumbdimension) AND (imgheight GTE maxthumbdimension)) {       resizewidth = imgwidth;       resizethumbwidth = (maxthumbdimension / divide_by_value);       diagnostics = diagnostics & "Portrait, larger than thumbmax but smaller than max.<br>";       resize = "true";     } else {       /* Image smaller than thumbnail in both dimensions.         Don't create new thumbnail. */       diagnostics = diagnostics & "Smaller than thumbmax. [ELSE]<br>";       resize = "false";     }   }      /* Doublecheck the portrait/resizewidth = maxthumbdimension bug */   if ((orientation EQ "portrait") AND (resizethumbwidth EQ maxthumbdimension)) {     resizethumbwidth = (maxthumbdimension / divide_by_value);     /* diagnostics = diagnostics & "Bug trapped!<br>"; */   }   if (resize EQ "true") {     /* Scale down large images using the resizewidth value */     imgObj.resize(fullImgPath, "#fullImgPath#", resizewidth);     imgObj.resize(fullImgPath, "#fullThumbPath#", resizethumbwidth);     diagnostics = diagnostics & "Resize true, Image and thumbnail created.<br>";   } else if ((imgwidth LT maxthumbdimension) AND (imgheight LT maxthumbdimension)) {     imgObj.resize(fullImgPath, "#fullThumbPath#", imgwidth);     diagnostics = diagnostics & "Resize false, Image and thumbnail created.<br>";   } else {     imgObj.resize(fullImgPath, "#fullThumbPath#", resizethumbwidth);     diagnostics = diagnostics & "Resize false, but creating a properly sized thumbnail. [ELSE]<br>";   } </cfscript> If this isn't enough, I can make a zipped copy of the CFM template available. Pete

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Massimo Foti
10/10/2005 05:34 AM

> Put it out there Pete. I'd be interesting in seeing what else you added to > it, There's a few things that I wish tmt_img did differently. All in all, > it's a great piece of code though. Thank you Massimo. I have a few things I would add/improve for the next version. Please feel free to provide feedback here or contact me directly at: massimo@massimocorner.com ---------------------------- Massimo Foti Tools for ColdFusion and Dreamweaver developers: http://www.massimocorner.com ----------------------------

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Webmaster at FastTrack On Line
10/10/2005 09:17 AM

I'm catching up on this thread, but ... I do think CF should have image manipulation.  I'm not about to go and learn Java or anything vaguely "codey" if i can possibly help it, not enough hours in the day and I bought CF for the very reason I would never have to learn Java!  Programming at that level just isn't for me, I find it tedious. I have used  http://www.imagemagick.org/script/index.php as a work around and it works just fine, and it's free :-) Jenny

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
10/07/2005 09:15 AM

Massimo's tag has getHeight and getWidth methods. Call those on an image, then check accordingly. <!----------------//------ andy matthews web developer ICGLink, Inc. andy@icglink.com 615.370.1530 x737 --------------//---------> Thanks guys - I've been following this with interest as I have a particular resizing challenge at the moment. What I'm looking for is a way to test the size of an image before its displayed and then resize it if its width exceeds 250px - if 250px or less then it can be left alone. Not sure if tags like Massimo's support that or not. Any suggestions please. ++++++++++ Kevin Parker Web Services Consultant WorkCover Corporation p: 08 8233 2548 m: 0418 806 166 e: kparker@workcover.com w: www.workcover.com ++++++++++ > That's what I tried to do when > I wrote version 2.0 of my CFC and I achieved a huge increase in quality. Massimo: Just to let you know... I was playing around with your CFC, and noticed that on some images (usually horizontally oriented ones), bufferedCrop() would throw an "outside of raster" error. I was able to fix it by modifying the code to check for crop operations that exceed the height of the image. With that said, thanks for putting the code out there. -- Roger Benningfield http://admin.support.journurl.com/ http://admin.mxblogspace.journurl.com/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan Stevenson
10/07/2005 11:44 AM

Well ya weren't following that close Kevin....I posted CFC methods to check image dimensions AND another to re-size....a couplde of CFIFs and those will get ya what ya want ;-) Cheers Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Massimo Foti
10/10/2005 05:20 AM

> What I'm looking for is a way to test the size of an image before its > displayed and then resize it if its width exceeds 250px - if 250px or > less then it can be left alone. > > Not sure if tags like Massimo's support that or not. My CFC offers all the basic functionality you need for this, but you have to perform the logic (if exceeds crop, if not let it alone) on your own. In my opinion the best thing to do would be to extend the CFC and put your logic there. This would allow you to first, separate the logic from the core functionality, then it will make easier to update as soon as I will release an updated version of the CFC since you would not change my code directly. ---------------------------- Massimo Foti Tools for ColdFusion and Dreamweaver developers: http://www.massimocorner.com ----------------------------

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Martin Parry
10/07/2005 03:27 AM

ImageCR3 does that impeccably. When specifying dimensions for the resize you put >250x>100  and it will resize the width down to 250 if greater and/or the height down to 100 is greater than 100 with prefect quality results. Martin http://www.beetrootstreet.com Thanks guys - I've been following this with interest as I have a particular resizing challenge at the moment. What I'm looking for is a way to test the size of an image before its displayed and then resize it if its width exceeds 250px - if 250px or less then it can be left alone. Not sure if tags like Massimo's support that or not. Any suggestions please. ++++++++++ Kevin Parker Web Services Consultant WorkCover Corporation p: 08 8233 2548 m: 0418 806 166 e: kparker@workcover.com w: www.workcover.com ++++++++++ > That's what I tried to do when > I wrote version 2.0 of my CFC and I achieved a huge increase in quality. Massimo: Just to let you know... I was playing around with your CFC, and noticed that on some images (usually horizontally oriented ones), bufferedCrop() would throw an "outside of raster" error. I was able to fix it by modifying the code to check for crop operations that exceed the height of the image. With that said, thanks for putting the code out there. -- Roger Benningfield http://admin.support.journurl.com/ http://admin.mxblogspace.journurl.com/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Bryan Stevenson
10/07/2005 11:45 AM

> ImageCR3 does that impeccably. When specifying dimensions for the resize > you put >250x>100  and it will resize the width down to 250 if greater > and/or the height down to 100 is greater than 100 with prefect quality > results. as does mine....look at the scaleBy attribute....ensures that dimension is within given size limit Bryan Stevenson B.Comm. VP & Director of E-Commerce Development Electric Edge Systems Group Inc. phone: 250.480.0642 fax: 250.480.1264 cell: 250.920.8830 e-mail: bryan@electricedgesystems.com web: www.electricedgesystems.com


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

March 12, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31