Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
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
Comment #1
Andre-Bwhy 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.
Comment #2
Perignon CreditAttribution: Perignon commentedAndre-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.