Hi,

I have a class that has the initial container as Filesystem and second container as Amazon S3.
I have a file field where I can upload images and pdfs.

The image/pdf is uploaded locally, uploaded to S3 on cron, then removed from initial container.

I would like to watermark the image/pdf before it is sent to S3 or after the file was uploaded.
How can I do that?

If I try to add the watermark on hook_file_insert, the file is not uploaded to S3 anymore.
I get this:
Amazon S3 error: The Content-MD5 you specified did not match what we received.

Any help would be great. Thanks.

Comments

Andre-B’s picture

why deliver the original file? you can always use image styles and have image styles with added watermarks, that are stored on s3. that wont work for pdf's though.

Perignon’s picture

Status: Active » Fixed

Andre-B's solution with the image styles will do what you are wanting to do. The only issue then is PDF's which will require some sort of PDF handling library or third party software.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.