Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Help With <CFImage>

Status
Not open for further replies.

LyndonOHRC

Programmer
Sep 8, 2005
603
US
Hi, just trying some of the new stuff in CF 8 and hit a wall right away.

I'm trying to resize an image, goal is to have a max size for member photos. Not trying to do much fancy.

I followed the advice in this article on scaling an image:
When I run the cfimage resize tag, commented out in the code below, it works fine. Please Help!
Code:
<cfimage name="memberPhoto" source="Graphics\#GetMember.Photo#">
<.cfscript> 
	ImageSetAntialiasing(memberPhoto,"on"); 
	[COLOR=red]ImageScaleToFit[/color](memberPhoto,”800”,”800”"bicubic");
</.cfscript> 
<!--- <cfimage action="resize"
     height="50%" 
     width="50%" 
     source="#memberPhoto#"
     destination="Graphics\#GetMember.Photo#"
     overwrite="true"/> --->
<cfimage action="write" 
	source="#mainImage#"
	destination="Graphics\#GetMember.Photo#" 
              overwrite="true" /> 
<img border="0" src="Graphics\#GetMember.Photo#" >

I'm getting the following error:

Code:
Missing argument name.  
When using named parameters to a function, every parameter must have a name.
The CFML compiler was processing:

An expression beginning with ImageScaleToFit, on line 75, column 65.This message is usually caused by a problem in the expressions structure.
A script statement beginning with [COLOR=red]ImageScaleToFit[/color] on line 75, column 65.
A cfscript tag beginning on line 73, column 58.
A cfscript tag beginning on line 73, column 58.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
OK, I solved this error. I have no idea why the code above does not work. I found another example of this in the actual LiveDocs and it works like a charm.

Solution:
Code:
<cfimage name="memberPhoto" source="Graphics\#GetMember.Photo#">
<cfset ImageScaleToFit(memberPhoto,"200","","bicubic")>
<cfimage action="write" 
	source="#memberPhoto#"
	destination="Graphics\#GetMember.Photo#" 
             overwrite="true" /> 
<img border="0" src="Graphics\#GetMember.Photo#" >

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
I don't know. But, that is how the the Adobe example is written in the provided link.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top