Get the TIFF image through curl


#1

Hi All,

I want to get the image using API sent by my client. I am using CURL for that API.
The basic idea is to get the image of all users (around > 2000) and update profile picture with this image in my application.

So I am sending curl in loop of users. I am getting bas64_encode data for that images (TIFF) as a response which I am decoding, converting into JPG and then update picture of that user in my application.

However, it takes around an hour to process around 1000 records.

Please help me with the way I am doing, If so, best way to reduce the time.

Your help will be highly appriciated.


#2

1000 records in 1 hour that means it takes 3.6 seconds ( on average ) per record.

Now if you take the time into account that the curl request will take and then converting it from TIFF to JPG then it doesn't seem too bad.

Alter the script that you can run 2 or more instances at a time. You would have to have some sort of flag to indicate which images have been or are being updated so that the script doesn't try to update an image that has already been updated.

You can also increase memory etc but I guess the suggestion above would be the best in my mind.


#3

Are the TIFF images particularly large, or is the connection to their source particularly slow? If either (or both) is the case, there's not a lot you can do about it.


#4

Hi Thanks for the reply.

@stephan2307: We have thought of processing into batch. We are checking how to go about this.

@droopsnoot: The encoded of image is around 500kb in size.


#5

So 500kb per image equates to roughly 150kb per second - how does that compare to the speed of the connection? I'm not sure whether these are across an internet connection or on a closer connection.


closed #6

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.