3

I try to load into UIWebView of a UIViewController a 360 panorama which is in html format and built in krpano. When the panorama opens all work properly. Although after some time, I get much of these errors to console :

Feb 28 14:02:54 iPhone-tou-chreste-Phanes Epirus Treasures[4687] 
<Error>: ImageIO: JPEG Not a JPEG file: starts with 0x00 0x00

And then finally the app crashes with this exception.

***** Terminating app due to uncaught exception 'NSRangeException', 
   reason: '*** -[WebCoreSharedBufferData getBytes:range:]: range {0, 4000} 
   exceeds data length 0'
*** First throw call stack:
(0x30474e83 0x3a7d16c7 0x30474dc5 0x30dafd05 0x303cd2ad 0x311ae397 
 0x311ae271 0x311ca417 0x311c97ef 0x311c9535 0x311c936d 0x311c92db 
 0x311cd249 0x311ccd27 0x311b5c8b 0x304fc46d 0x328a74e1 0x328a6991 
 0x3289280b 0x3289232d 0x3288f083 0x3288d7a1 0x3acbae7b 0x3acb7f93 
 0x3acbb745 0x3acbb9c5 0x3ade5dff 0x3ade5cc4)
libc++abi.dylib: terminating with uncaught exception of type NSException**

I searched the web but i cant find a solution to this. Any advice would help me.

Alex Cio
  • 6,014
  • 5
  • 44
  • 74
hoya21
  • 893
  • 7
  • 24
  • Take a look:[Has iOS 7 changed PNG compatibility/handling?](http://stackoverflow.com/questions/19574193/has-ios-7-changed-png-compatibility-handling) – Amar Feb 28 '14 at 12:26
  • I have already read it, but i cannot understand what can cause the problem . – hoya21 Feb 28 '14 at 12:30
  • The accepted answer suggests that the cause of issue was some weird image settings in Photoshop. Also says, `Recommendation for anyone reading this with a similar issue: re-export your files, under a variety of settings and conditions if need be, and see if they start working.` – Amar Feb 28 '14 at 12:32
  • So i have to check each .jpeg file? There are thousands. And also he did not notice which settings cause the problem. – hoya21 Feb 28 '14 at 12:37
  • Wow, that could be a pain. Sry, but I do not have anything else to add. Will update in case I find anything relevant. – Amar Feb 28 '14 at 12:38
  • Yes, it is impossible. Thanks for your time @Amar and inform me if you come up with this. – hoya21 Feb 28 '14 at 12:41
  • If there are thousands of files you might want to push them through a program like this: http://www.jpegmini.com/ - it's used to reduce file size of images for apps/websites but updates the original at the original file location (might get rid of that Photoshop bug in the process?). It's easier than File> Export> type > Saving 1000+ times... – Johnny Rockex Mar 20 '14 at 13:41

1 Answers1

0

I'd try to check each one. maybe you won't have to convert the entire image, rather check a few first bytes on each. Might actually not be that "painful".

Try to find a bad one, to test with.

Wiz
  • 474
  • 4
  • 11