stomita/ios-imagefile-megapixel

Scaling images with alpha channel

Closed this issue · 6 comments

Hi @stomita,

first thanks for your library, it's the first solution I've found that actually works around the canvas scaling issues on iOS devices.

However, since it uses the alpha channel to detect the iOS scaling bugs, there are rendering problems with images which do have an alpha channel, e.g. PNG or GIF images.

Any idea how to improve the detection to avoid this issue?

I've referenced your library in an issue on my own image loading script:
blueimp/JavaScript-Load-Image#13

Hmm, that is the point I realize. Because this is created as a workaround for photo uploading application, which mainly becomes JPG file. Currently I don't have any good idea to fix the scale before knowing that it has alpha channel.

OK, understandable.

One solution which works in your case (photo uploading application) and other cases where the image to display is loaded from a File object is to check if the File is of type "image/jpeg" and only then apply the subsampling and image squashing fixes.

By the way, under which license do you release your library? MIT? Public domain?

Added notice of license (MIT license)

ありがとうございました!^_^

hi stomita,
The problem i am facing is that whenever i am trying to draw an image on canvas,the image is getting zoomed in by itself and then getting drawn onto canvas(i.e. the image is getting drawn 2-3 times bigger ).I am facing this issue only in ios 6.In ios 5 the image is getting drawn appropriately.Any suggestions to resolve the issue?
Thanks in advance.

@batmanr can you please attach the image and code you faced the problem ?