Live data from Hacker News

WebKit Limit on Retina JPG Image Display

duncandavidson.com

31–40 of 45 posts

Re: WebKit Limit on Retina JPG Image Display

#31
post #13

We ran into this issue while building our HTML5/Mobile Webkit panorama viewer. It took a long time to figure out what was going on, I almost feel that webkit would've been better to just skip the image and log an error to the console, since by resizing your image without your permission typically causes rendering bugs since they literally resize your image down in-line without telling you. We didn't realize it could…

You could just slice it into multiple JPGs. It's probably even better for parallel download.

Well we already slice our images, and even those slices are too big. We were annoyed to have to maintain another set of files just for the iPad. So we just use a smaller (and blurrier when scaled up) image at the moment. I was hoping they would just open it up :)

Re: WebKit Limit on Retina JPG Image Display

#32

We ran into this issue while building our HTML5/Mobile Webkit panorama viewer. It took a long time to figure out what was going on, I almost feel that webkit would've been better to just skip the image and log an error to the console, since by resizing your image without your permission typically causes rendering bugs since they literally resize your image down in-line without telling you. We didn't realize it could…

Try switching your PNG's from RGB to Indexed color - depending on what the image is it can dramatically lower the file size.

Photos don't do so well in 8-bit color.

Re: WebKit Limit on Retina JPG Image Display

#33
I remember hitting a similar limit in webOS. There's a WebKit image cache setting set either at build time or startup time about how large of an image will be allowed to persist in the internal decoded image cache. When an image exceeds that, the decoder produces a scaled down version that's grown when displayed. We could adjust it on our platform with a setting in /etc/palm/browser.conf, but it wasn't adjustable without making the core file system writable and restarting the system manager.

Re: WebKit Limit on Retina JPG Image Display

#34
post #7
post #4

Another issue, but also there: PNG images above a certain height failed to load on the iPhone 4. We were facing that problem with our mobile testing tool. Converting the images to JPG solved the problem.

In case you're wondering why that is .. > JPEG images can be up to 32 megapixels due to subsampling, which allows JPEG images to decode to a size that has one sixteenth the number of pixels. JPEG images larger than 2 megapixels are subsampled—that is, decoded to a reduced size. JPEG subsampling allows the user to view images from the latest digital cameras. Reference: https://developer.apple.com/library/IOs/#document…

Yes. libjpeg can generate scaled previews faster than decoding the whole image. Maybe that's why Apple didn't bother to implement this for png images.

Re: WebKit Limit on Retina JPG Image Display

#35
I tested and confirmed that if you save the JPEG using Progressive formatting, then it displays fine on the iPad. The Apple "Big Hero" image also has progressive JPEG formatting.

This doesn't explain why regular JPEGs are treated special though.

Re: WebKit Limit on Retina JPG Image Display

#38
post #3
post #2

When working in UIKit developers are warned now to use images that are larger than 1024x1024 because that is the limit on the size if a texture in openGLES. I wouldn't be surprised to see this being doubled for the retina and Apple using that as the hard limit. ( You should avoid creating UIImage objects that are greater than 1024 x 1024 in size. Besides the large amount of memory such an image would consume, you may…

I believe that limit was lifted as of the iPhone 3GS (i.e., for OpenGL ES 2.0 devices and greater).

I think it's actually just been doubled to 2048x2048. OpenGL ES 2.0 seems to define a 64x64 as the minimum requirement for texture size to meet the spec, which is really not much at all.

Re: WebKit Limit on Retina JPG Image Display

#39
post #29
post #10

On a mostly unrelated note, I wish blatanly marketing driven terms like "retina display" would stop getting thrown around like this. Thanks to Apple's latest marketing adjustment for the iPad 3, it turns the phone I've owned for over 2 years now actually posesses a "retina display" (N900 for anyone wondering). At the viewing distance specified by Apple, the human retina is in fact capable of discerning a far higher p…

At the viewing distance specified by Apple, the human retina is in fact capable of discerning a far higher pixel density anyway. Yeah, just not according to actual doctors and optical specialists. But what do they know?

I was referring to studies made by actual doctors not PR campaigns.

Edit: For those downvoting this I should have probably provided supporting evidence, though oddly no one treated the parent post in the same way. Feel free to follow the references at the base of this article: http://clarkvision.com/imagedetail/eye-resolution.html

Re: WebKit Limit on Retina JPG Image Display

#40
post #10

On a mostly unrelated note, I wish blatanly marketing driven terms like "retina display" would stop getting thrown around like this. Thanks to Apple's latest marketing adjustment for the iPad 3, it turns the phone I've owned for over 2 years now actually posesses a "retina display" (N900 for anyone wondering). At the viewing distance specified by Apple, the human retina is in fact capable of discerning a far higher p…

How is he "throwing around" this term? He's specifically talking about the iPad 3. Apple uses this marketing term to signal to the purchaser that they are going to get a certain pixel density. I see retina display, I know I will get a "good looking" display by Apple's standards. If I trust Apple, it means something. That's the purpose of marketing and branding. So what if your phone also has the same pixel density? D…

No, I have a problem with marketing that is intentionally deceptive and can easily confuse non-technical users into believing they're paying for something they're not.

Neither of your car manufacturer examples demonstrate this. However, when a certain US cellular carrier slapped a "4G" sticker on 3G technology simply to make their product appear competitive in the market that was not OK.

Similarly, implying to users the pixel density of their device matches the resolving capabilities of the retina, when actual scientific studies demonstrate otherwise, is not OK with me.

Post reply on HN