Denix
Denix

Reputation: 522

Accessing to variable from memory

I created an image class, it loads and resizes image, then crops and lastly watermarks it.

For last step, I would like to add IPTC data to the this image. For what I know there is only iptcembed function to accomplish this. The problem is iptcembed needs the path of image as parameter. I'm keeping image as object before using it to render views.

$content = iptcembed($data, "./image.jpg");

I do not want to save image to storage just to create a path for iptcembed but I couldn't find another way to add IPTC data to the image.

Is there any way (or function) to access to this object from memory instead of saving and loading from storage?

Upvotes: 2

Views: 97

Answers (2)

Mallory Green
Mallory Green

Reputation: 1

I use CFX_OpenImage to read and write IPTC_ data in .jpg files using ColdFusion Language versions 8 thru 11. I also use CFX_OpenImage for image resize and rotation.

For more CFX_OPENIMAGE INFO go to http://www.kolumbus.fi/jukka.manner/cfx_openimage/

The software download includes a good manual of at least 65 pages.

Upvotes: 0

andrew
andrew

Reputation: 9583

You could use php://memory to have a file handle that reference in-memory data instead of data written to a file.

Credit goes to this original answer

Upvotes: 1

Related Questions