Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
RokuMarkn
Visitor

Re: Can Roku generate a JPG or PNG file?

"squirreltown" wrote:

RokuKC - "yes, it doesn't surprise me that the time to convert to PNG + upload PNG is greater than the time to upload raw pixel data, at least for larger bitmap dimensions and/or on lower end hardware."
I'm sure that means something.


Kevin was comparing two operations:
1. Convert bitmap to png, then upload the (relatively small) png
2. Convert bitmap to bytearray, then upload the (relatively large) bytearray (= raw pixel data)
He's observing that converting the bitmap to png is time-consuming, and that the conversion in #1 may overwhelm the savings in the upload time. But uploading a small file will be faster than uploading a large file. Uploading 3 MB will take twice as long as uploading 1.5 MB, no matter what the bytes represent.

The server receives the exact same bytes that are in the file that you passed to AsyncPostFromFile. There's no such thing as "sending a file as text, not as an image file". Data sent out on the network is just bytes, they're not treated differently depending on the file type.

Like EnTerr, I'm puzzled about what your invocation of ImageMagick is doing, but I don't think it's necessary. GetPng has already converted the file to png; you don't need to convert it again. (jpg is not involved anywhere.) That's probably why your png upload is taking so long; your script is doing this long convert operation before it tells the Roku that the transfer is done.

--Mark
0 Kudos
squirreltown
Roku Guru

Re: Can Roku generate a JPG or PNG file?

"RokuMarkn" wrote:


Like EnTerr, I'm puzzled about what your invocation of ImageMagick is doing, but I don't think it's necessary. GetPng has already converted the file to png; you don't need to convert it again. (jpg is not involved anywhere.) That's probably why your png upload is taking so long; your script is doing this long convert operation before it tells the Roku that the transfer is done.

--Mark


Imagemagik is up-sizing the file and adding a profile. It has nothing to do with this which i why i didn't mention it. This is a minor issue that i simply mentioned, not something that's hanging me up. I appreciate your input.
Kinetics Screensavers
0 Kudos
RokuMarkn
Visitor

Re: Can Roku generate a JPG or PNG file?

Well, try removing the convert line and I bet your upload time decreases dramatically.

--Mark
0 Kudos