Closed (works as designed)
Project:
ImageCache Actions
Version:
7.x-1.1
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Feb 2013 at 20:53 UTC
Updated:
28 Feb 2013 at 14:39 UTC
So I'm processing the original image in the public files directory and have everything working so that I have a result in tmp.
For drupal6 I'd set the path to the file and return true; and my result would be copied to the appropriate imagecache directory.
For drupal 7 it just returns the original image. How do I return my image to imagecache?
$image->source = $tmpdir.'/'.$output_image_name;
return true;
Comments
Comment #1
fietserwinThis is explained in the readme.txt from the customactions module and depends on whether you are using the imagemagick or GD toolkit. In the former case you should add your command line arguments to the $image->ops array, in the latter case, you should not save your image but make $image->resource refer to your final GD resource.
Comment #2
sgriffin commentedIn using a third party program. Neither gd or im.
Comment #3
dman commentedSo, um, what part of imagecache_actions are you using?
Generally one or the other would be required for the system to even try and do anything.
Comment #4
sgriffin commentedI'm using ptstitcher for processing a panoramic image. I have everything working. The result is just waiting in tmp. This is actually an upgrade to my d6 module. There it was easy. I just set image->source to the path of the result and it was used.
Comment #5
sgriffin commentedI'm using the image cache actions for to specify input and output parameters and the call back effect function to pass the image object to build the command and run it.
Comment #6
dman commentedI don't understand what you are saying about how you use imagecache_actions here. Which of the actions are you using? A PHP customaction?
Are you sure this question is about the effects provided by this module, or is this a support request about how to build effects like the ones that this module provides?
What does the system *think* it's using? - GD or IM. Image derivatives just won't process unless one of those is chosen - even if you are choosing to ignore it.
If the system expects you to be using GD, you could potentially just read in your temp image from that file using GD, and set the $image->resource to that data.
Comment #7
sgriffin commentedSorry, It's a custom imachecache actions module.
Ok great. How do I read in the image using gd?
Comment #8
dman commentedAfter setting the $image->source to the path of the file you've just made,
you could call Drupals
which would re-load and re-initialize the ->resource
This means that when the time comes for the system to save the new file in the new derivative place, it's your data that gets saved.
... that's one way to start trying anyway.
Comment #9
sgriffin commentedYou are awesome dman@! Worked like a charm.
I believe you helped me 5 years ago on the first version of this module.
Thank you SO much!
Comment #10
sgriffin commentedComment #11
sgriffin commented[columbo]One more question![/columbo]
The image style still has the original image dimensions when outputted. How do I change this? In the custom actions docs, it says to set the image info width and height, but its not working when the image displayed is set to my imagecache style.
<img typeof="foaf:Image" src="http://xxx.seeit360.com/sites/default/files/styles/test/public/coit_s.jpg?itok=_q-HPJTq" width="3000" height="1500" alt="">Comment #12
sgriffin commentedNevermind got it!
Comment #13
dman commentedYeah that is an annoying callback that was added in D7.
You need to use a callback now. Most of the core effects have predictable dimensions so it works. A few of my effects just don't.
Comment #14
dman commentedxpost