Instagram AmazingRibs Facebook AmazingRibs X - Meathead Pinterest AmazingRibs Youtube AmazingRibs

Welcome!


This is a membership forum. Guests can view 5 pages for free. To participate, please join.

[ Pitmaster Club Information | Join Now | 30 Day Trial | Login | Contact Us ]

Only 4 free page views remaining.

Announcement

Collapse
No announcement yet.

Erroneous error message when photo files too large

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Erroneous error message when photo files too large

    Been meaning to flag this but keep forgetting, but it just happened again so here I am.

    When uploading an image file (jpg in my case) that exceeds the site's size limit (5 MB? not sure), the error dialog says "content of the file does not match the extension", which is clearly nonsense, it's just too large. I edit the file to decrease its size, and then it uploads.

    It would be great if the error message said instead, the file is too large. Thanks!

    #2
    I would have to investigate the original image to be sure. But the error message may be correct.

    When you resize, that may fix the "content of the file does not match the extension" issue.

    Any file can have any extension you want to change it to.

    So a PNG file can have a .JPG extension. That is what the system is detecting.

    This is only my first guess.

    I want to investigate this further to figure out what is really going on. I will email you.

    Comment


      #3
      Thanks Ray, got your email. I haven't kept track of just which images this has occurred with (it has been at least 20 times), and once I edit them (I don't resize, I just crop the edges a tiny bit) they no longer trigger the error. So I don't have the original from this most recent time (I overwrite with the cropped image).

      It occurred to me that it may be restricted to photos I take in Panorama mode on my Android. I just took a couple and am now going to try to upload right here as an experiment.

      *drum roll please*

      And sure enough, both of them got the error message. One file was 12 MB, the other 7MB. I screengrabbed:

      Click image for larger version  Name:	image.png Views:	0 Size:	127.2 KB ID:	1539958
      Now I shall do the teeny-tiny crop job, trimming the barest bit. BTW I do the cropping in the Windows built-in simple image editor, I don't open a program to do it. Now the file sizes are 7.5 and 4.2 MB respectively (even removing an unnoticeably thin sliver results in that much reduction).

      *second drumroll*

      And they both work fine. Here they are, larger one first. Note that the larger one is still larger than the smaller one's original size (7.5 vs 7) and it uploads fine. This tells me that it might have something to do with some kind of meta info embedded in the pano that gets stripped out when any editing is done...

      Click image for larger version  Name:	20240117_081037-crop.jpg Views:	0 Size:	7.36 MB ID:	1539960
      Click image for larger version  Name:	20240117_081053-crop.jpg Views:	0 Size:	4.13 MB ID:	1539959

      Ray, I just emailed you these originals. Hope this helps.

      Comment


        #4
        Yes. Those helped!

        Mystery solved. The issue is that the images being generated do not specify the specific image format (JFIF / JPEG File Interchange Format).

        It only shows the EXIF (Exchangeable image file format) part. Which is used by just about all images. JPG, TIF, WAV, PNG, and WEBP.

        So when uploaded, the software sees the JPG extension, then looks for the JFIF encoding at the start of the image file and does not find it.

        And throws an errors.

        For sure the images are not encoded incorrectly as all my image editors and viewers can open theme and understand they are JPEGs.

        The issue is that the forum software is not aware of the "panoramic" images and how they are encoded. I will see if I can fix that.

        By example: you can see in the HEX dump that the start of the original does not have the "JFIF" part (which is what the forum software is looking for).

        But when I fix that, by just opening in an editor and saving, it now contains the "JFIF" part. And will upload fine.

        Click image for larger version

Name:	hexdump-image-compare.png
Views:	200
Size:	417.2 KB
ID:	1540213

        Comment


          #5
          I don't know if this is related. When I take a picture with my phone the extension is .heic. If I attempt to upload an error occurs. Basically saying an invalid format. All I do is edit/crop and it is .jpg., it now uploads. No big deal as I normally do some cropping prior to uploading.

          Comment


          • RAYMBO
            RAYMBO commented
            Editing a comment
            Correct. The system does not recognize that file type. I will see if I can fix that.

          • RAYMBO
            RAYMBO commented
            Editing a comment
            Sorry, I cannot fix this one. Only the Safari browsers (apple) will render that image format. So all the other browsers will not display it.

          #6
          Update. I started to think this was a real bug in the code.

          I hunted for the code the checks this and, for JPEG, it only looks at the first 2 and the last 2 bytes

          The first 2 bytes will be FFD8 for JPEG. And both the original and the fixed version have that. I thought it would key on the entire code (6 to 24 bytes) that contains the JFIF text, but not so.

          The last two bytes will be FFD9 for JPEG. Those exists on the fixed version, but not the original.

          Panoramic JPEG files end in 4 bytes (53454654) (which just spells SEFT).

          So the real issue is that the code is not aware of the Panoramic file format or the correct ending bytes.

          I have added a little hack to remedy that issue. If the test for JPEG fails for the normal ending bytes, it then checks for the panoramic ending bytes.

          These files should be allowed to upload now.​

          Comment


          • DaveD
            DaveD commented
            Editing a comment
            Wow!!! This is some amazing cyber forensics. You rock, Ray!

          #7
          raywjohnson I assume you have referencing my post. If so, I tried again and the same error occurs. IThanks and don't worry about it. As I said a simple crop converts to a valid format.

          On another note, I could have missed it but have you always been in Thailand?

          Comment


          • RAYMBO
            RAYMBO commented
            Editing a comment
            Yep. It still fails. Works on my local testing version. I will double check the code.

          • RAYMBO
            RAYMBO commented
            Editing a comment
            Ok. Try it now. I forgot to PULL the changes from Github to the server. :|

          #8
          Great job raywjohnson When I read the first post I immediately thought of this issue. My software company wrote the file control software for the federal judiciary and we never even looked at extensions but at the information embedded in the file itself to determine its type, and if marked classified or restricted we changed the file so no other software could open or print the file except through our software. Again, a good job locating the problem.

          Comment


            #9
            Absolutely mad skillz here from Ray. We're not worthy!

            Comment


              #10
              Sorry no go here's the error.

              20240117_231519.heic
              Upload failed. You are not allowed to upload files with the extension heic.
              OK​

              Comment


              • mnavarre
                mnavarre commented
                Editing a comment
                On iOS/iPadOS you can go to Settings>Camera>Formats and set it to Most Compatible. That saves pictures as JPEG, but some stuff won't work and they'll take up more space than HEIC, but if it's worth it to you to avoid the hassle it might be worth it.

              • RAYMBO
                RAYMBO commented
                Editing a comment
                Only the Safari browser can display HEIC files (according to Wikipedia: As of September 2023, only Safari supports HEIC format natively). And only about 18% of users run Safari. So the other 80% would not be able to see your images.

              #11
              raywjohnson It works!!! Your code fix now allows upload of panoramas. Here's one of the unedited panos that would not upload yesterday:

              Click image for larger version  Name:	20240117_081037.jpg Views:	0 Size:	11.30 MB ID:	1540306

              Thank you so much for figuring this out!

              EDIT: And Ray, while we're sorta on the subject, what IS the filesize limit for photos on the forum?
              Last edited by DaveD; January 18, 2024, 07:16 AM.

              Comment


                #12
                raywjohnson a follow up. I went into the camera app setting. There's an option to make the format high efficiency which was enabled. It also noted it wasn't compatible with all web sites and platforms. I turned it off, took a picture and sure enough it was jpg format. Im not sure how it got enabled. 🙄

                Comment


                • J-Melt
                  J-Melt commented
                  Editing a comment
                  Thank you for this!!! I’ve always been frustrated that anytime I air drop pictures to my mac I have to do through extra steps to get them to jpeg that can be emailed. I just changed my settings too.

                #13
                I feel so close to Ray right now. I do digital forensics professionally so I spend a lot of time looking at FF D8 FF.

                As a bit of trivia, my favorite file header is the pre-Office 2007 (.doc, .xls, .ppt, etc.) file header: D0 CF 11 E0.

                Get it? D0CF11E0 or "DOCFILE"

                Comment


                • DaveD
                  DaveD commented
                  Editing a comment
                  Nrrrrrrrrrrrrrrrrrd!

              Announcement

              Collapse
              No announcement yet.
              Working...
              X
              false
              0
              Guest
              Guest
              500
              ["membership","help","nojs","maintenance","shop","reset-password","authaau-alpha","ebooklogin-start","alpha","start"]
              false
              false
              Yes
              ["\/forum\/free-deep-dive-guide-ebook-downloads","\/forum\/free-deep-dive-guide-ebook-downloads\/1157845-paid-members-download-your-6-deep-dive-guide-ebooks-for-free-here","\/forum\/the-pitcast","\/forum\/national-barbecue-news-magazine","\/forum\/national-barbecue-news-magazine\/national-barbecue-news-magazine-aa","\/forum\/national-barbecue-news-magazine\/national-barbecue-news-magazine-aa\/bbq-news-magazine-2019-issues","\/forum\/national-barbecue-news-magazine\/national-barbecue-news-magazine-aa\/bbq-news-magazine-2020-issues","\/forum\/national-barbecue-news-magazine\/national-barbecue-news-magazine-aa\/bbq-news-magazine-2021-issues","\/forum\/national-barbecue-news-magazine\/national-barbecue-news-magazine-aa\/bbq-news-magazine-2022-issues","\/forum\/national-barbecue-news-magazine\/national-barbecue-news-magazine-aa\/current-2023-issues","\/forum\/national-barbecue-news-magazine\/national-barbecue-news-magazine-aa\/current-2024-issues","\/forum\/national-barbecue-news-magazine\/national-barbecue-news-magazine-aa\/current-2025-issues","\/forum\/national-barbecue-news-magazine\/national-barbecue-news-magazine-aa\/current-2026-issues","\/forum\/bbq-stars","\/forum\/bbq-stars\/tuffy-stone","\/forum\/bbq-stars\/meathead","\/forum\/bbq-stars\/harry-soo","\/forum\/bbq-stars\/matt-pittman","\/forum\/bbq-stars\/kent-rollins","\/forum\/bbq-stars\/dean-fearing","\/forum\/bbq-stars\/tim-grandinetti","\/forum\/bbq-stars\/kent-phillips-brett-gallaway","\/forum\/bbq-stars\/david-bouska","\/forum\/bbq-stars\/ariane-daguin","\/forum\/bbq-stars\/jack-arnold","\/forum\/free-deep-dive-guide-ebook-downloads"]
              /forum/free-deep-dive-guide-ebook-downloads