Comments (6)
Hi @HexMox ,
Do you still having this issue?
I just tested it on a IOS simulator(iPhone XS IOS 12.1) and it is working fine.
According to the can i use website, the OffscreenCanvas should be undefined in IOS safari.
https://caniuse.com/#feat=offscreencanvas
The "typeof OffscreenCanvas === 'function'" should evaluate as "false" and the code "document.createElement('canvas')" should be executed.
Would you mind to test it again to confirm the issue?
Thanks.
from browser-image-compression.
Hi Donaldcwl, Thanks for your reply.
There may be a few differences between iOS simulator and iPhone.
I added fallback logic which will reports some error messages when occurs unexpected error.
from browser-image-compression.
I have found this problem too. � and it only occurs on iphone x.
from browser-image-compression.
@ccirene Since I don't have a physical iPhone X and simulator doesn't reproduce the issue, can you try to debug for me?
what is the value of following statements:
console.log('is function?', typeof OffscreenCanvas === 'function')
console.log('new works?', new OffscreenCanvas(10, 10))
console.log('getContext works?', (new OffscreenCanvas(10, 10)).getContext('2d'))
console.log('drawImage is function?', (new OffscreenCanvas(10, 10)).getContext('2d').drawImage)
Thanks!
from browser-image-compression.
HI, thank you for helping me.
It console.log as below.
"is function? true
new works? [object OffscreenCanvas]
getContext works? null
TypeError: null is not an object (evaluating 'new OffscreenCanvas(10,10).getContext("2d").drawImage')
"
it seems getContext('2d') doesn't work at iphone x
from browser-image-compression.
@ccirene Can you try this version of the library to see if it works on iPhone X?
browser-image-compression.zip
It seems that the problem is OffscreenCanvas.getContext('2d') return null on iPhone X which means this "2d" context identifier is not supported on iPhone X.
I am trying to fall back to HTMLCanvasElement (document.createElement('canvas')) instead.
from browser-image-compression.
Related Issues (20)
- Black image after compression on iOS HOT 1
- imageCompression error on nextjs HOT 1
- BMP file extension not sustained HOT 1
- Image reference error in Webworker HOT 1
- BMP file size wrongly increased
- Error catch bypass? HOT 1
- The compression yields a result image with 96 dpi HOT 1
- Big png file result in an a 0 byte broken image HOT 3
- The received filepath suffix disappears after compression HOT 3
- Image Compression On Ipad Safari Browser Results In Black Image When Image Is Over 10MB HOT 2
- Why does it take longer in my app than in the demo HOT 2
- Background Discord
- Question About CDN Usage in Web Worker Since v2.0.1
- Don't increase the DPI when compressing an image HOT 1
- Try imageCompression() catches a ProgressEvent instead of an error HOT 1
- Compression stuck on iPhone XS Max iOS 17.0.3 HOT 1
- Slow HOT 1
- Inconsistent output from main and web worker
- System is hanging when we are trying to load 30 images of 100MB size.
- errorMsg: "ReferenceError: Can't find variable: FileReader" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from browser-image-compression.