Skip to main content

Empty File

Comments

5 comments

  • Stephen Doyle

    Hi,
    I've checked our backend logs and as far as I can tell, we're not receiving any data in the file.

    Can you share some more about how you're sending the file? The code you're using to send the upload API call, if possible?

    Are you able to debug the HTTP request which is being made and see if the file is being sent but in the wrong parameter, is your python process able to read the file on disk, etc?

    Thanks,
    Stephen

    0
  • kiwi software

    Hi,

    I traced the stack and find out where the problem is :

    def save(self, *args, **kwargs):

    if self.post_preview_image:
    """
    compressing image
    """
    new_image = compress(self.post_preview_image)
    self.post_preview_image = new_image

    super().save(*args, **kwargs)

    I'm compressing this image and this function can not find the image to compress. how can I fetch the image pass it to this function ?

     

    0
  • Stephen Doyle

    Can you please let me know some more information about what you're doing in this workflow?

    Is that 'compress image' function uploading the file to Cloudinary and then downloading it again with transformations applied like adjusting the quality level or size, or do you want to download a file from your Cloudinary account and pass it to a local function? 

    What value are you seeing for 'self.post_preview_image' before and after calling the compress function? is it a file stored in your Cloudinary account?

    0
  • kiwi software

    I didn't know that it is possible to compress images with Cloudinary . But, to clarify why I'm using this local function is to read the image and then compress it. The thing you mentioned here "to download a file from your Cloudinary account and pass it to a local function?"  is what I wanted. I appreciate if you can also tell me how to compress images with cloudinary as well.

    Thnaks,

    Iliya

    0
  • Aditi Madan

    Hi Lliya,

    Cloudinary provides media optimizations. You can use f_auto and q_auto which automatically compresses the image while making sure the visual quality is kept and it also has the ability to automatically detect which browser is requesting the image and then selecting the most efficient image format to deliver.

    There are even more tips that can help you optimize your bandwidth consumption even further, for more information:

    https://support.cloudinary.com/hc/en-us/articles/202521522-How-can-I-make-my-images-load-faster-
    http://cloudinary.com/documentation/image_optimization

    Regards,
    Aditi

    0

Post is closed for comments.