• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cfimage performance issues

Guest
Oct 01, 2007 Oct 01, 2007

Copy link to clipboard

Copied

I'm using cfimage to resize a jpg and paste a png on to that jpg. It is running very slow (more than a minute an image) and I have to process 100 images. I was using the Alagad image component with CF 7 and it was very quick. Now with the same code on CF8 it is very slow...using CFimage or Alagad. I am also getting Java out of memory errors. Attached is a code snippet.

Any suggestions to increase performance?


TOPICS
Advanced techniques

Views

1.9K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 01, 2007 Oct 01, 2007

Copy link to clipboard

Copied

"Now with the same code on CF8 it is very slow...using CFimage or Alagad."

Let me calrify the above line of yours....Are you saying that CFIMAGE and ALAGAD both are slow on CF8 ?

Is it slow all the time or only the first time you access this page ?

Also can you post the error messages encountered ?

Thanks
Jayesh Viradiya
Adobe CF Team

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 01, 2007 Oct 01, 2007

Copy link to clipboard

Copied

quote:

..Are you saying that CFIMAGE and ALAGAD both are slow on CF8 ?

>>correct they are both very slow...it seems around the same speed.

quote:

Is it slow all the time or only the first time you access this page ?

All the time. And, the more I try, the more Java memory errors I get. I'm using CFDynamics as a host, and they have applied the latest hotfixes.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 02, 2007 Oct 02, 2007

Copy link to clipboard

Copied

Here is the out of memerory error message--

thanks--

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 05, 2007 Oct 05, 2007

Copy link to clipboard

Copied

Hi,
I tried with cfimage(CF8) and alagad(on CF7 and CF8). I have used the same scenario as you mentioned in the code. i.e
1. To read a jpg image (70kb)
2. Resizing it.
3. Pasing a .png file on it
4. Writing it back to disk

To process 100 such images both cfimage and alagad are taking less than a minute.
Here is the code for cfimage:

<cfset t1 =Now()>
<cfloop from=0 to=100 index=cf_index step=1>
<cfset imageToConvert = "C:\ColdFusion8\wwwroot\testbench\test" & "\" & "Sunset.jpg" >
<cfset imageToWrite = "C:\ColdFusion8\wwwroot\testbench\test" & "\" & "Sunset_resize" & "#cf_index#" & ".jpg">

<!--- cfimage --->
<cfset myImage=ImageRead(imageToConvert)>

<cfset ImageResize(myImage,"1349","1753","HIGHESTPERFORMANCE")>
<cfimage source="C:\ColdFusion8\wwwroot\testbench\test\test.png" name="topImage">
<cfset ImagePaste(myImage,topImage,0,0)>

<!--- output the new image --->
<cfset ImageWrite(myImage,imageToWrite)>
</cfloop>
<cfimage source=#myImage# action = "writeToBrowser">

<cfset t2 = Now()>
<cfset t3 = DateDiff("s", t1,t2)>

<br /><cfoutput>Time taken : <cfdump var = "#t3#"> sec</cfoutput>


Thanks
Kunal Saini
Adobe CF Team

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Oct 05, 2007 Oct 05, 2007

Copy link to clipboard

Copied

Thanks for looking into this Kunal. I found out why this was taking very long for me. The PNG I was pasting over the jpgs was at a resolution of 300 dpi. When I changed it to 72, the code ran quickly. So beware, using ImagePaste with an image over 72 dpi will suck up a ton of memory and take a long time. This doesn't seem to be an issue using Alagad's component on CF7, so I'm thinking this is a bug in CF8.

-Karl

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
May 18, 2009 May 18, 2009

Copy link to clipboard

Copied

LATEST

Thanks Karl.  I changed my image to 72dpi and it did process much faster, but the resulting image was still inverted with colors missing.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation