Tagged: image optimisation, image upload trigger, shortpixel
Hi,
Me again (sorry)..
I’ve been working with the team at Shortpixel (image optimisation) their service optimises an image once it’s uploaded by a user. We’ve hit a problem in that when Mediapress items are uploaded, they don’t get optimised after upload.
“problem is that the gallery uploader appears not to be firing the usual actions when an image gets uploaded: ‘wp_handle_upload’ and ‘wp_generate_attachment_metadata’. ”
I wonder if you have any thoughts on how I can maybe fix this in Mediapress?
Hi Audiomonk,
Thank you for posting and there is no need to apologise. Please feel free to ask/post any question.Yes, It is correct that we do not fire ‘wp_handle_upload’ and ‘wp_generate_attachment_metadata’. It was intentional to avoid 3rd party plugins changing our path or generating extra files.
The user uploaded files are different from the normal uploads. These don’t need to be generated in so many sizes.
If we kept these two, there would have been great many conflicts with 3rd part plugins.
It is very easy to make any optimization plugin work with MediaPress.
All a plugin need to do is attach the same callback to MediaPress filters
mpp_generate_metadata mpp_handle_upload
what they have attached to ‘wp_generate_attachment_metadata’ and ‘wp_handle_upload’ respectively.
Regards
BrajeshThank you Brajesh for this and for all the support you give, you are the best and a real example of what good, friendly and helpful support is.
The topic ‘ [Resolved] Mediapress upload and Image optimisation’ is closed to new replies.