Highlighted

Need help using ImageCrop()

Participant ,
Nov 10, 2015

Copy link to clipboard

Copied

I have passed an image and crop values to my form action page. I want to crop the image and then save it to disk. the imagecrop() function s returning an error: The result of the method ImageCrop cannot be assigned because it does not return a value.


Here's what I've tried:

<cfset myImage = ImageReadBase64("#form.xBase64PhotoString#")>

<cfset myImage=ImageCrop(myImage,Val(form.x),Val(form.y),Val(form.w),Val(form.h))>

<cfimage source="#myImage#" destination="c:/workgroups/webdata/badgecards/#BadgPhotoName#" action="write" overwrite="Yes">

The imagecrop is a new process for this existing template. The bse64 and cfimage/destination lines work fine.

Thanks in advance.

Lyndon

The error message tells you what the problem is. The ImageCrop function does not return a value. Don't try to assign a non-result to a variable. In other words, remove "myImage=" from the problem line.

Cheers

Eddie

Views

169

Likes

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

Need help using ImageCrop()

Participant ,
Nov 10, 2015

Copy link to clipboard

Copied

I have passed an image and crop values to my form action page. I want to crop the image and then save it to disk. the imagecrop() function s returning an error: The result of the method ImageCrop cannot be assigned because it does not return a value.


Here's what I've tried:

<cfset myImage = ImageReadBase64("#form.xBase64PhotoString#")>

<cfset myImage=ImageCrop(myImage,Val(form.x),Val(form.y),Val(form.w),Val(form.h))>

<cfimage source="#myImage#" destination="c:/workgroups/webdata/badgecards/#BadgPhotoName#" action="write" overwrite="Yes">

The imagecrop is a new process for this existing template. The bse64 and cfimage/destination lines work fine.

Thanks in advance.

Lyndon

The error message tells you what the problem is. The ImageCrop function does not return a value. Don't try to assign a non-result to a variable. In other words, remove "myImage=" from the problem line.

Cheers

Eddie

Views

170

Likes

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
Nov 10, 2015 0
Advocate ,
Nov 10, 2015

Copy link to clipboard

Copied

The error message tells you what the problem is. The ImageCrop function does not return a value. Don't try to assign a non-result to a variable. In other words, remove "myImage=" from the problem line.

Cheers

Eddie

Likes

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
Reply
Loading...
Nov 10, 2015 2
Participant ,
Nov 10, 2015

Copy link to clipboard

Copied

Perfect!

That was in the examples; I couldn't see the forest for the trees I guess.

Thank you

Likes

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
Reply
Loading...
Nov 10, 2015 0