Why does the figure show black image only in Matlab?

I'm sorry, Dave. I cannot show you these images.

  • Is there some sort of free-as-in-beer program to tell you what if anything is wrong with an image? I'm part of this project at work where we're scanning and uploading images to put online through some proprietary software. The project has been basically stalled for months because IE 8 and IE 9 are very confused about what to do with the images (IE 8 still has enough of the market share that we can't ignore it). The images are all jpegs of various shapes and sizes, typically 72 dpi and several thousand pixels along the longest dimension. Firefox and Chrome both always show all the images fine, but sometimes IE 8 won't show an image that IE 9 will, or IE 9 won't show an image that IE 8 will, and sometimes an image that works in IE 8 on one machine won't work in IE 8 on another, and when IE fails to show the image there's a wide range of ways it might fail. Sometimes it pulls up an empty window where the image should be, sometimes it's an outline of the image with a red X (even though the image is definitely there and other programs can show it), and sometimes the image might flash onscreen and then disappear. I've been talking for months with someone at the company that makes the software which is supposed to be handling these images, and while the company has been patient and persistent in trying to figure out the cause, they also haven't yet figured it out, so the project has been stalled all this time. Management wants this to move ahead. I want this to move ahead (God, do I ever want this to move ahead). Today it occurred to me I could load the images on a flash drive and see if they all load directly in IE, which could at least eliminate the possibility that it's a problem with the images themselves. I didn't expect it to be a problem with the images themselves, because--again--Firefox and Chrome handle them just fine. Many of the images wouldn't load from the flash drive in IE 8, though they were all there, and the OS could read the filesize and pixel dimensions. Many of these exact same images gave different behavior in the exact same browser on the exact same machine when we loaded them directly from the URL. Some of these images showed different behavior on two different but supposedly completely identical machines, both running the exact same version of IE 8 (down to the last x in 8.x.xxxx.xxxx). Is there some free (or affordable) program which at least can help us analyze these images and find out what, if any, irregularities there are about them? I'm way out of my depth here, but even something like "this file has a header reporting it to be a jpeg-whatever-x when it's a jpeg-whatever-y"--something that can maybe put us on track towards getting this resolved?

  • Answer:

    Have you considered just converting them all to the same format instead of displaying them as is?

anonymous at Ask.Metafilter.Com Visit the source

Was this solution helpful to you?

Other answers

Were they by any chance in CMYK color format? Try opening them in Photoshop, converting to RGB, and saving. A Google of https://www.google.com/search?q=why+won%27t+ie8+display+jpg&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a gave some promising info along these lines. http://social.expression.microsoft.com/Forums/en-US/web/thread/17ec253f-aac5-4598-a47a-a6ff8affbf3b, http://stackoverflow.com/questions/1204288/jpeg-shows-in-firefox-but-not-ie8. If that is the problem, there seems to be a way to batch convert them using ImageMagick.

amtho

http://www.irfanview.com has some advanced image information, as well as some batch conversion tools that may help you.

deezil

Seconding IrFanView to open the images and resave them as JPGs. It's lighting fast in its batch conversions.

Brandon Blatcher

For getting image info, the imagemagick tools include one called "identify" that is probably as good as anything. You can download them http://www.imagemagick.org/script/binary-releases.php#windows. You can easily save the output using:identify -verbose file.jpg > fileinfo.txtHowever, I think you may be hitting a problem I ran into with large images - IE will run out of memory and just flat out refuse to load some images (red X or sometimes a missing image entirely). In our case we had maybe 10 extremely large images [approx 10,000 x 2,000) on each page, and after viewing a lot of these pages it would randomly start to fail to load some images - restarting IE would make the exact same page work fine. It never crashed and the more sane sized images would always load ok - just some of the huge ones would fail to load at random. So to eliminate that, when an image fails to load try restarting the browser and loading it again. (we fixed this by replacing the images with thumbnails and only showing one huge image at a time). If that's not it, and you can find an image the reliably breaks IE8 then you could always post a sample - friendly Mefites will probably be able to spot the problem quickly (or feel free to mefimail me in confidence).

samj

It's a bear, but my go-to for this sort of thing is http://www.imagemagick.org/. The http://www.imagemagick.org/script/convert.php might help. It's command line only afaik, but if you or someone else is proficient with this sort of thing, it might be useful for converting them all to a single format (which is convert's primary purpose in life) or to see if you can get convert (or any of the other tools) to spit out some relevant metadata that might help you figure out what's different about those particular images. More usage details http://www.imagemagick.org/script/command-line-processing.php. I'd try converting them all to one format, or converting from whatever they're in to BMP and back into something specific. That'll force a full re-encode which might be productive. There are other convert flags for messing with color depth and various encoding details that might also be useful. It'll do batch conversion pretty easily, as you can see in the docs.

heresiarch

On post, yeah, samj has good advice too. I'd forgotten about identify. Definitely give that a shot! But in terms of repair, I think your best bet will be in convert. Unless, ofc, the problem is the size. That's definitely another plausible explanation.

heresiarch

just because FF/Chrome display them fine doesn't mean it's not a problem with the images. we had a problem like that in the IE6/IE7 period - I don't remember the exact details but one version of IE refused to show some images. IIRC, the problem turned out to be thumbnails embedded in a format that one version of IE didn't like. I'm assuming that isn't your exact problem, but confirming whether the images load fine directly from a flash drive will help narrow down whose problem this is to fix. one other thing that made troubleshooting our issue difficult was that after loading a "broken" image, all JPEG image rendering would be flaky until a reboot. once we realized this the situation became deterministic and much easier to diagnose.

russm

From the OP:We found that the images themselves are fine, but still created smaller versions to test their behavior. These also all tested as fine. With the smaller images, IE would always display the first 10 or 12 images that were opened, and would begin failing to display them in different ways after that. This failure was not dependent on the images at all--testing a list of images in the same order, closing and reopening the browser each time, would cause fairly consistent results: IE got flaky around picture 11 or 13. But testing that same list of images from the bottom up would cause the last 10 or 12 to work and all the rest to fail. Testing them in a random order would cause different behavior yet again. After looking into it a fair amount and trying several possible solutions, none of which worked, we determined that the odd behavior we were seeing was a fundamental flaw in IE. We're using this system in a workplace where we have a fair amount of control over the machines, which cannot be upgraded to IE 9, so we changed the default browser on those machines. Of course we still have no control over what browser our customers use, but IE 9 can handle dozens of the images in a row, so maybe eventually the issue will be mooted. Given that IE 9 still has bugs I wrote about when IE 5 was new, that's a minor miracle.

jessamyn

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.