|
Hmmm,
It's been a long time (months) since I last looked at what you are doing. I think last I looked you were ripping out parts of the TrueType parsing code from STB[^] or something.
I think it has JPEG and PNG decoders too, have you looked?
|
|
|
|
|
Yeah, but they're not geared for IoT. I had to gut the truetype stuff to make it all work from a stream instead of RAM. I wound up changing most of that file.
I don't want to go through the same thing with the PNG loading. I'd like to look for a different source - preferably something that loads it progressively.
The STB stuff is PC gaming code so it's geared for having gobs of RAM.
To err is human. Fortune favors the monsters.
|
|
|
|
|
honey the codewitch wrote: I'd like to look for a different source - preferably something that loads it progressively.
I just glanced over the PNG spec and progressive decoding only works on PNG images that were 'progressive encoded'. I think that means multiple IDAT sections. With a normal (non-progressive) PNG having a single IDAT.
So you would only benefit here if you control the image encoding too. Progressive encoded PNG images are rare today from my understanding.
|
|
|
|
|
I think I can still do it line by line
To err is human. Fortune favors the monsters.
|
|
|
|
|
Sweet,
Can you point out which step in decoding PNG images uses lines? I'd like to see how it's done.
Here's an overview[^], show me which decoding step uses lines.
|
|
|
|
|
I couldn't say off hand. I was looking at some code on github some months back on doing this.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Any reason you can't convert a suitable image to jpg and add it to your GitHub project? It would then be easily accessible and your preferred format.
Keep Calm and Carry On
|
|
|
|
|
That would defeat the purpose of the demo, which is to load a picture off a network stream.
Edit: Never mind. I see what you mean. I'm a bit slow today. Yeah, I could do that.
To err is human. Fortune favors the monsters.
|
|
|
|
|
honey the codewitch wrote: Should I implement png?
Yes.
And WebP[^].
And AVIF[^].
And don't forget APNG[^] too.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
I'm not making a web browser. I need bare minimum functionality. This isn't a Cortex-A I'm targeting.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Quote: I'm not making a web browser.
Not at the moment... But all the stuff I'm reading from you, there is a chance that you develop a web browser for ATTINY85 or similars
|
|
|
|
|
Okay, I deserved that.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Why limit yourself to a logo? Using a company logo has drawbacks anyway, such as legal copyright etc., or implications of involvement with the company (as you suggest by not wishing to use Microsoft or Facebook examples).
Why not choose a public domain image of a recognisable landmark or figure, or even take your own photo of such a thing and host it on the web (thus avoiding any IP issues)?
(Finding small JPGs is likely to be a hard task anyway since for small images, there is often little benefit in using JPG compression - it just results in ugly artefacts if compression is high and no advantage if compression is low. It's larger images where JPG comes into its own, really...)
|
|
|
|
|
viewing an image over the web does not violate copyright laws, even if the viewer is an IoT device.
To err is human. Fortune favors the monsters.
|
|
|
|
|
True, but if you (say) use the Coca-Cola logo and advise people to view said logo on your device (even as a proof-of-concept) there's the risk that Coca-Cola will complain (fair use, passing-off, trademark etc) or demand you include a copyright / trademark notice. If you're aiming to have an instantly-recognisable logo, companies of that size/fame can be a bit tetchy about how their logo is used. Very unlikely, true, but possible. But for those same reasons of control and wanting a "perfect" viewing experience, they're unlikely to have a .JPG logo anyway.
|
|
|
|
|
Pretty sure Coca-Cola isn't going to come after me for a sample project. I'll risk it.
To err is human. Fortune favors the monsters.
|
|
|
|
|
JPG legally requires a licensing fee. As a result PNG was developed to avoid this fee.
|
|
|
|
|
I think that was .GIF, which was developed by Compuserve who got a bit tetchy about it. Not aware of a license fee for JPG images...
|
|
|
|
|
You can get random, free to use photo JPEGs from Lorem Picsum[^]. For example, try loading https://picsum.photos/320/240 from your code.
|
|
|
|
|
No. It just embraces transparency. For unknown reasons. Ahhchooo!
|
|
|
|
|
|
|
If you do find one please let the internet authorities know so the guilty can be thrown in jail. JPEG is for photos. Using it for logos, technical drawings and similar is just horrible.
|
|
|
|
|
Corporate logos tend to be lossless so they can be displayed in their maximum quality.
|
|
|
|
|
LOL!
Even the "Joint Photographic Experts Group" page uses PNG!
JPEG site[^]
|
|
|
|