Device-Bugs icon indicating copy to clipboard operation
Device-Bugs copied to clipboard

Limitation for iOS

Open frontenddeveloping opened this issue 11 years ago • 3 comments
trafficstars

All this limits are actual for iOS 7:

  • The maximum size for decoded GIF, PNG, and TIFF images is 3 megapixels for devices with less than 256 MB RAM and 5 megapixels for devices with greater or equal than 256 MB RAM.
  • The maximum size for a canvas element is 3 megapixels for devices with less than 256 MB RAM and 5 megapixels for devices with greater or equal than 256 MB RAM.
  • JavaScript execution time is limited to 10 seconds for each top-level entry point.

https://developer.apple.com/library/ios/documentation/AppleApplications/Reference/SafariWebContent/CreatingContentforSafarioniPhone/CreatingContentforSafarioniPhone.html#//apple_ref/doc/uid/TP40006482-SW15

frontenddeveloping avatar Jun 20 '14 05:06 frontenddeveloping

This limits don't throw any errors, so then you will try to render or read 6MB image you will get a broken blob/dataURL string and so on. And you will think that File API is broken, canvas methods toDataURL/toBlob are broken, and you will be right. But bugs aren't in browser, this is a system limitation.

So this limitations create a broken behavior for javascript API. And I think they should be added here like a bugs.

It's a just duck typing for bugs: if limitation works like bugs, looks like bugs, I will call this limitations - bugs.

frontenddeveloping avatar Jun 20 '14 05:06 frontenddeveloping

Anyone find a way around this? I'm trying to do image cropping before it gets sent off to the server and I can't load images taken with the camera.

RangerMauve avatar May 07 '15 14:05 RangerMauve

@RangerMauve try https://github.com/stomita/ios-imagefile-megapixel

frontenddeveloping avatar May 20 '15 10:05 frontenddeveloping