How to upload webP image format using cloudinary IOS sdk ?
Hi,
I haven't been able to upload webP format using IOS sdk. However from android it provides an option to upload webP format. Please send me a documentation ( if any ) to understand how i also upload webP format from IOS.
Regards,
Explurger Team
-
Hi,
Here is an example of how to upload a webp in IOS:
let request = cloudinary.createUploader().upload(
url: URL(fileURLWithPath:"<path to the webp image>.webp"), uploadPreset: "<your preset>",params: params as! CLDUploadRequestParams)
.response( { response, error in
print(error);
} )
Regards,Aditi
0 -
Hi,
Thanks for reply. Is there any way to convert jpeg image into webP during the process of uploading image to cloudinary server ?
CLDPreprocessHelpers.customImageEncoder(format: EncodingFormat.PNG) -> This function doesn't accept webP as a value.
Regards,
Explurger Team
0 -
Hi,
Our best practice will be to upload the image as is and generate the transformation eagerly. For example:
let trans = CLDEagerTransformation().setFormat("webp");
let params = CLDUploadRequestParams().setPublicId("mynewVideo").setEagerAsync(true).setEager([trans]).setResourceType(CLDUrlResourceType.image);
let request = cloudinary.createUploader().signedUploadLarge(url: URL(fileURLWithPath:"/XXXX/dog.webp"), params: params as! CLDUploadRequestParams).response({ response, error in print(response,error);})However, If you want to upload the file just as `webp` and not have it in jpg anywhere (not our best practice). You can set a default upload preset and set the format to webp.
Can you please elaborate on why you want to change the format before the upload and not change the format later by using our on-the-fly or eager transformation?
Also note that webp is not supported in the old versions of the ios.
0
Post is closed for comments.
Comments
3 comments