Offloading Media
-
Hello. I was using this great plugin and WP Offload Media Lite Plugin to serve faster media. I was using Videopack for watermarking videos and I wanted to offload videos that has been processed on watermarking.
I asked the author of WP Offload Media and he said that
WP Offload Media should re-offload the images after they have been processed, but it does depend on whether the watermarking process calls one of the functions that triggers the re-offload.
If it’s your own custom code that does the watermarking, then please ensure that after the files for a Media Library item have been processed that your code does something like the following…
wp_update_attachment_metadata( $item->ID, wp_generate_attachment_metadata( $item->ID, $file ) );
The important call there is wp_update_attachment_metadata(), if you already have the attachment’s metadata you don’t need to regenerate it, just pass it in.
WP Offload Media will see the wp_update_attachment_metadata filter fired by the function of the same name, and copy the attachment’s file to the bucket, overwriting the previous versions if already offloaded.
I would recommend using the as3cf_pre_upload_attachment filter to cancel the original offload though, and then remove that filter before doing the final wp_update_attachment_metadata. That way you don’t waste time offloading to the bucket and re-offloading again, and it ensures CDNs only see the final watermarked files.
If you’re using a watermarking plugin, might be worth passing the above info onto the author if you’re seeing issues.
-IJ
I wanted the videos watermarked to be offloaded while there are still in queue. Does this plugin works as the author said ?
Thanks a lot!
- The topic ‘Offloading Media’ is closed to new replies.