Closed (fixed)
Project:
ImageCache Actions
Version:
6.x-1.1
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
29 Dec 2008 at 17:52 UTC
Updated:
7 Jan 2009 at 15:45 UTC
I'm trying to return a completely different image in a couple of different cases when and action is run, , but the unaltered image is returned instead and Im not sure why.
I've tried the following...
$success_image = imageapi_image_open(realpath(success.gif');
$image = $success_image;
return $image;
The following works fine, but it's not what I'm after.
return imageapi_image_crop($image, 1, 1, 80, 80);
I am processing the original not with gd or imagemagick and I don't care about the original image at all, I only want to move the result into the preset folder or return another graphic.
Thanks for any advice or pointers.
Comments
Comment #1
sgriffin commentedYes, there's a syntax error. It was sanitized a little too much.
I was able to use imageapi_image_open in straight php and was able to access the image and attributes just not the same code with canvasactions.
Comment #2
sgriffin commentedAnyone?
Comment #3
dman commentedWhen I looked at this issue, I just couldn't tell enough about the context from the short snippet.
Are you talking about running php with custom actions, or is there some interaction problem with a module you are developing??
You may be interested to know that the $image object is NOT a GD image resource. It's an object that contains extra metadata, including the dimensions, filenames, toolkit in use, and a $image->res object that is the GD resource you probably want to mess with. This is how all the imagecache processes function. Have a look at any of the existing code - eg imageapi_image_crop() to see how it actually does stuff.
Comment #4
sgriffin commentedThanks I will take a look at it.
I was using imagecache to accept custom input values for transformations on an image, and the image is returned in a specified directory. The problem I was facing is getting a return of the output into the preset folder. So I was trying to replace/return $image with the output I created by the custom image program. I will take another stab at it. Thanks for the pointer.
Comment #5
sgriffin commentedNot sure what I was thinking or if I am doing this right, but I was able to move the result into the proper preset place, and update $image->source and return true, and all is well. For some reason, I thought I would just return the image, and pass the ball back and imagecache would put it in the proper preset place itself.