stomita/ios-imagefile-megapixel

Multiple scaling iterations - scaling existing canvas images

Closed this issue · 1 comments

In some use cases, it might be necessary to pass an existing canvas element as image to resize to the library, e.g. when it is necessary to do multiple successive scaling iterations.

The first issue with this is the usage of the naturalWidth and naturalHeight properties in the library functions, which can be worked around by using img.naturalWidth || img.width and img.naturalHeight || img.height respectively.

However even with these adjustments the second scaling iteration didn't work and simply returned a blank canvas.

Any idea on what might be necessary to extend the library to allow scaling of existing canvas elements?

OK, this seems to have more to do with the maximum image pixel size display limitations in iOS:
Know iOS Resource Limits

Apparently, writing images exceeding the pixel limitations to a canvas will simply result in a blank canvas.
Therefore this issue can be closed.