Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Is the web allergic to JPG?

Is the web allergic to JPG?

Scheduled Pinned Locked Moved The Lounge
question
36 Posts 15 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H honey the codewitch

    I was going to make a small demo of loading a jpg from the web and consuming it on an ESP32 The image should be small (320x240 ish) because i can't resize it, it should be retrievable by an end user for verification and hopefully it would be a prominent recognizable figure on the web. Here's what I've checked: Code Project's logo (gif) Google's logo (png) Twitter (png, and huge) Reddit (not easily retrievable) Github (not easily retrievable) Youtube (not easily retrievable) Here's what I don't want to promote - even by way of a demo: Microsoft Facebook I feel like maybe I have some tunnel vision. Surely there is site with a prominent logo in jpg that's easily accessible from a browser, no? Am I being unrealistic? Should I implement png? (I really don't want to for reasons)

    To err is human. Fortune favors the monsters.

    Richard DeemingR Offline
    Richard DeemingR Offline
    Richard Deeming
    wrote on last edited by
    #9

    honey the codewitch wrote:

    Should I implement png?

    Yes. And WebP[^]. And AVIF[^]. And don't forget APNG[^] too. ;P


    "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

    "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

    H 1 Reply Last reply
    0
    • Richard DeemingR Richard Deeming

      honey the codewitch wrote:

      Should I implement png?

      Yes. And WebP[^]. And AVIF[^]. And don't forget APNG[^] too. ;P


      "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

      H Offline
      H Offline
      honey the codewitch
      wrote on last edited by
      #10

      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.

      0 1 Reply Last reply
      0
      • L Lost User

        What space? All you would need to do is parse it into a BITMAPINFOHEADER structure and write the DIB directly to your screen. The only space required might be your BITMAPINFOHEADER header definition. :-D

        H Offline
        H Offline
        honey the codewitch
        wrote on last edited by
        #11

        And without a proper use case there's no reason for it, even if it's only a BITMAPINFOHEADER that has no business being in there without a use case. JPGs have dozens of use cases - heck I use them in my commercial projects w/ this lib. Arguably, so do PNGs for similar reasons. But a web "ICO" which is not a real windows ICO, no. Literally the only thing they're good for is displaying a little picture in a web browser for a particular url. There's no use case there for IOT, not really. That's why I won't include it. Now, there are some fairly good use cases for implementing BMP support which is similar, but the actual spec for that is nasty, and way too complicated to do me any good for what I'm targeting. MS should have kept it simple.

        To err is human. Fortune favors the monsters.

        L 1 Reply Last reply
        0
        • K k5054

          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

          H Offline
          H Offline
          honey the codewitch
          wrote on last edited by
          #12

          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.

          1 Reply Last reply
          0
          • OriginalGriffO OriginalGriff

            Nobody who uses images on websites cares about that - it's "just a image stream" and if one format has an advantage for them, they'll use it. And a transparency layer is an advantage to many site builders. They don't care about poor old us, after all! :laugh:

            "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt AntiTwitter: @DalekDave is now a follower!

            H Offline
            H Offline
            honey the codewitch
            wrote on last edited by
            #13

            Yeah, I think finally implementing PNG might be the way to go here.

            To err is human. Fortune favors the monsters.

            1 Reply Last reply
            0
            • H honey the codewitch

              And without a proper use case there's no reason for it, even if it's only a BITMAPINFOHEADER that has no business being in there without a use case. JPGs have dozens of use cases - heck I use them in my commercial projects w/ this lib. Arguably, so do PNGs for similar reasons. But a web "ICO" which is not a real windows ICO, no. Literally the only thing they're good for is displaying a little picture in a web browser for a particular url. There's no use case there for IOT, not really. That's why I won't include it. Now, there are some fairly good use cases for implementing BMP support which is similar, but the actual spec for that is nasty, and way too complicated to do me any good for what I'm targeting. MS should have kept it simple.

              To err is human. Fortune favors the monsters.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #14

              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?

              H 1 Reply Last reply
              0
              • L Lost User

                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?

                H Offline
                H Offline
                honey the codewitch
                wrote on last edited by
                #15

                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.

                L 1 Reply Last reply
                0
                • H honey the codewitch

                  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.

                  0 Offline
                  0 Offline
                  0x01AA
                  wrote on last edited by
                  #16

                  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 ;P :laugh:

                  H 1 Reply Last reply
                  0
                  • 0 0x01AA

                    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 ;P :laugh:

                    H Offline
                    H Offline
                    honey the codewitch
                    wrote on last edited by
                    #17

                    Okay, I deserved that. :laugh:

                    To err is human. Fortune favors the monsters.

                    1 Reply Last reply
                    0
                    • H honey the codewitch

                      I was going to make a small demo of loading a jpg from the web and consuming it on an ESP32 The image should be small (320x240 ish) because i can't resize it, it should be retrievable by an end user for verification and hopefully it would be a prominent recognizable figure on the web. Here's what I've checked: Code Project's logo (gif) Google's logo (png) Twitter (png, and huge) Reddit (not easily retrievable) Github (not easily retrievable) Youtube (not easily retrievable) Here's what I don't want to promote - even by way of a demo: Microsoft Facebook I feel like maybe I have some tunnel vision. Surely there is site with a prominent logo in jpg that's easily accessible from a browser, no? Am I being unrealistic? Should I implement png? (I really don't want to for reasons)

                      To err is human. Fortune favors the monsters.

                      D Offline
                      D Offline
                      DerekT P
                      wrote on last edited by
                      #18

                      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...)

                      H 1 Reply Last reply
                      0
                      • H honey the codewitch

                        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.

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #19

                        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.

                        H 1 Reply Last reply
                        0
                        • H honey the codewitch

                          I was going to make a small demo of loading a jpg from the web and consuming it on an ESP32 The image should be small (320x240 ish) because i can't resize it, it should be retrievable by an end user for verification and hopefully it would be a prominent recognizable figure on the web. Here's what I've checked: Code Project's logo (gif) Google's logo (png) Twitter (png, and huge) Reddit (not easily retrievable) Github (not easily retrievable) Youtube (not easily retrievable) Here's what I don't want to promote - even by way of a demo: Microsoft Facebook I feel like maybe I have some tunnel vision. Surely there is site with a prominent logo in jpg that's easily accessible from a browser, no? Am I being unrealistic? Should I implement png? (I really don't want to for reasons)

                          To err is human. Fortune favors the monsters.

                          O Offline
                          O Offline
                          obermd
                          wrote on last edited by
                          #20

                          JPG legally requires a licensing fee. As a result PNG was developed to avoid this fee.

                          D 1 Reply Last reply
                          0
                          • L Lost User

                            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.

                            H Offline
                            H Offline
                            honey the codewitch
                            wrote on last edited by
                            #21

                            I think I can still do it line by line

                            To err is human. Fortune favors the monsters.

                            L 1 Reply Last reply
                            0
                            • D DerekT P

                              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...)

                              H Offline
                              H Offline
                              honey the codewitch
                              wrote on last edited by
                              #22

                              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.

                              D 1 Reply Last reply
                              0
                              • H honey the codewitch

                                I was going to make a small demo of loading a jpg from the web and consuming it on an ESP32 The image should be small (320x240 ish) because i can't resize it, it should be retrievable by an end user for verification and hopefully it would be a prominent recognizable figure on the web. Here's what I've checked: Code Project's logo (gif) Google's logo (png) Twitter (png, and huge) Reddit (not easily retrievable) Github (not easily retrievable) Youtube (not easily retrievable) Here's what I don't want to promote - even by way of a demo: Microsoft Facebook I feel like maybe I have some tunnel vision. Surely there is site with a prominent logo in jpg that's easily accessible from a browser, no? Am I being unrealistic? Should I implement png? (I really don't want to for reasons)

                                To err is human. Fortune favors the monsters.

                                M Offline
                                M Offline
                                markkuk
                                wrote on last edited by
                                #23

                                You can get random, free to use photo JPEGs from Lorem Picsum[^]. For example, try loading https://picsum.photos/320/240 from your code.

                                1 Reply Last reply
                                0
                                • H honey the codewitch

                                  I think I can still do it line by line

                                  To err is human. Fortune favors the monsters.

                                  L Offline
                                  L Offline
                                  Lost User
                                  wrote on last edited by
                                  #24

                                  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.

                                  H 1 Reply Last reply
                                  0
                                  • L Lost User

                                    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.

                                    H Offline
                                    H Offline
                                    honey the codewitch
                                    wrote on last edited by
                                    #25

                                    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.

                                    1 Reply Last reply
                                    0
                                    • H honey the codewitch

                                      I was going to make a small demo of loading a jpg from the web and consuming it on an ESP32 The image should be small (320x240 ish) because i can't resize it, it should be retrievable by an end user for verification and hopefully it would be a prominent recognizable figure on the web. Here's what I've checked: Code Project's logo (gif) Google's logo (png) Twitter (png, and huge) Reddit (not easily retrievable) Github (not easily retrievable) Youtube (not easily retrievable) Here's what I don't want to promote - even by way of a demo: Microsoft Facebook I feel like maybe I have some tunnel vision. Surely there is site with a prominent logo in jpg that's easily accessible from a browser, no? Am I being unrealistic? Should I implement png? (I really don't want to for reasons)

                                      To err is human. Fortune favors the monsters.

                                      R Offline
                                      R Offline
                                      RedDk
                                      wrote on last edited by
                                      #26

                                      No. It just embraces transparency. For unknown reasons. Ahhchooo!

                                      1 Reply Last reply
                                      0
                                      • H honey the codewitch

                                        I was going to make a small demo of loading a jpg from the web and consuming it on an ESP32 The image should be small (320x240 ish) because i can't resize it, it should be retrievable by an end user for verification and hopefully it would be a prominent recognizable figure on the web. Here's what I've checked: Code Project's logo (gif) Google's logo (png) Twitter (png, and huge) Reddit (not easily retrievable) Github (not easily retrievable) Youtube (not easily retrievable) Here's what I don't want to promote - even by way of a demo: Microsoft Facebook I feel like maybe I have some tunnel vision. Surely there is site with a prominent logo in jpg that's easily accessible from a browser, no? Am I being unrealistic? Should I implement png? (I really don't want to for reasons)

                                        To err is human. Fortune favors the monsters.

                                        P Offline
                                        P Offline
                                        PIEBALDconsult
                                        wrote on last edited by
                                        #27

                                        Jpg is filth.

                                        1 Reply Last reply
                                        0
                                        • O obermd

                                          JPG legally requires a licensing fee. As a result PNG was developed to avoid this fee.

                                          D Offline
                                          D Offline
                                          DerekT P
                                          wrote on last edited by
                                          #28

                                          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...

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular
                                          • World
                                          • Users
                                          • Groups