5 Replies Latest reply on Sep 26, 2008 4:02 PM by pixlor

    JPG unknown file type?

    johngordon12 Level 1
      I have a site for a client where he can upload images of goods for sale (digital photo frames and baby monitors), and have just had an email from him about images not displaying.

      In the instances they don't display, I'm using a GD library based script to show thumbnails of the original images.

      You can see what I mean here :

      example here

      However, if you click through to the details page, and then on the image itself, it displays fine.

      Having looked into it, tried uploading other images, I can see nothing wrong.

      I tried opening the JPG in FW to export it out as a new JPG to see what that would do, but FW wouldn't open it - reporting it as an unknown file type.

      One of the images is here :

      example image

      So I guess my question is what's the issue with the image, that's preventing the GD script and FW from recognising it as a valid file type, even though its a .JPG?
        • 1. Re: JPG unknown file type?
          pixlor Level 4
          When a program tells you a file isn't the right type, it usually knows what it's talking about. There's more to a format than an extension. You can put any extension on a file you want, but that doesn't make it that format.

          I opened your file in binary mode in my text editor. It didn't have any header information at all. I then opened a file I know to be a .jpg. They looked completely different. So, as an experiment, I changed the extension on your file from .jpg to .bmp and dragged it into Fireworks. It opened just fine.

          Your client needs to save his images as JPGs, not just change the extension.
          • 2. Re: JPG unknown file type?
            Level 7
            On Fri, 26 Sep 2008, pixlor wrote

            > I opened your file in binary mode in my text editor. It didn't have
            >any header information at all.

            I think you would find it did. The first two bytes would be hex 424D
            which is 'BM' in ASCII, and BM means BitMap format.

            --
            Richard Mason
            http://www.emdpi.com
            • 3. Re: JPG unknown file type?
              pixlor Level 4
              quote:

              Originally posted by: Newsgroup User
              On Fri, 26 Sep 2008, pixlor wrote

              > I opened your file in binary mode in my text editor. It didn't have
              >any header information at all.

              I think you would find it did. The first two bytes would be hex 424D
              which is 'BM' in ASCII, and BM means BitMap format.

              --
              Richard Mason
              http://www.emdpi.com



              Thanks Richard! I shall remember that! I guess I expect headers to be more...extensive! Thanks also for the confirmation.

              • 4. Re: JPG unknown file type?
                johngordon12 Level 1
                Cheers guys - I don't know what the original files were - but its all sorted now. Apparently whatever caused them to act up happened when my client cropped the originals.
                • 5. Re: JPG unknown file type?
                  pixlor Level 4
                  quote:

                  Originally posted by: Iain71
                  Cheers guys - I don't know what the original files were - but its all sorted now. Apparently whatever caused them to act up happened when my client cropped the originals.

                  *blinks*

                  The files were BITMAPS. The old-fashioned, uncompressed, Windows-standard .bmp file. Two people, using independent means have verified that this is so. When your client cropped them, he must have not saved the file properly. Unless your client knows how to use an imaging program properly, the same problem is going to happen again. He or she cannot simply add a .jpg extension or change the extension to .jpg and call it good. The extension must align with the file's header information, which are the first few bits or bytes in the file before the actual image data.