Compression and size adjustments when uploading a photo via SDK PHP
Trying to upload via SDK pictures, forcing the size to 1200 Max and having a the compression set to 85%
While we are able to resize on upload, we cannot find a way to also set the compression to 85, and the pictures therefore always are saved on Cloudinary far too big.
What are we missing to set the compression to any value, on upload to cloudanary?
This is the code we are trying to use:
public function img_upload_parameterized($filename, $publicId = '', $options = array(), $tags = array())
{
Cloudder::upload($filename, $publicId, $options, $tags);
$getResult = Cloudder::getResult();
return $getResult;
}
$f_getResult = $this->function_model->img_upload_parameterized($file_image, $publicId = '', $options = array("width" => 1200), $tags = array());
Then we added the following to try to also control the compression but with no effect :)
$this->function_model->img_upload_parameterized($file_image, $publicId = '', $options = array("width" => 1200,"quality"=>50)
Many thanks for your help, we are really stuck with this.
-
Hi Patrick,
Thanks for contacting us.
The `Cloudder` library you are using, wasn't created and isn't maintained by Cloudinary, therefore we won't be able to assist you with this issue.
We do have an official community Laravel library that you can use. You can read more about it here:
https://cloudinary.com/blog/introducing_cloudinary_s_new_laravel_sdk
https://cloudinary.com/blog/laravel_file_upload_to_a_local_server_or_to_the_cloudI hope this helps, please let us know if there is anything else we can assist with.
0 -
We would be glad to move to your official library.
Can you just please confirm that your offical library will enable us to upload pictures, controlling the compression level? (I think you call it Quality level?)
Thanks!
0 -
Hi Patrick,
I can confirm you will be able to upload pictures and apply transformations (quality or others). The link Michal's mentioned should be helpful as they show how to perform those actions.
Loic
0 -
Thank you!
0 -
Hi Patrick,
You are welcome.
Don't hesitate to reach out here or to support@cloudinary.com in case you have any other questions.
Best,
Loic
0
Post is closed for comments.
Comments
5 comments