Some question about upload image
-
Hello,
I would like to ask about the plugin's handling of user uploaded images. How do I know if the image uploaded by the user is an avatar or a picture or a cover? Since I have to do different processing for different types of images, how should I read them in the plugin?
At the same time, I see that there is an action in the upload plugin to process the image as a url(Sample), but I have never triggered it. I would like to know when it will be entered into the conditions?
There are my upload plugin link.
-
filter:uploadImage
hook receives some params that you can use to differentiate between a profile/cover picture for a user vs an image that is uploaded to a post.When a cover or profile image is uploaded the folder passed to the hook is set to
profile
. Also the image object will have a name field that is set to eitherprofileAvatar
orprofileCover
depending on what is being uploaded. When you upload a image to a post the folder is set tofiles
.I think the upload from url is no longer used since that is handled client side now when someone tries to set their profile image from a url. In the past we used to download the image from that url server side but not it is handled client side with the cropper lib.