Comments (9)
I just published v4.1.1 so updating to the latest version should resolve.
from tesseract.js.
Thanks for reporting. I was able to replicate using the images provided in Tesseract.js.
Handling of .jpeg files is handled by Tesseract rather than anything specific to Tesseract.js. Therefore, this is definitely caused by issues with Tesseract dependencies rather than any JavaScript code in this repo.
I think the next question is whether this bug exists in the latest version of Tesseract (and the image processing libraries it uses) or if it has already been patched. It would be great if you could try and replicate with the latest version of the Tesseract CLI, and if the issue can be replicate with that, open an issue in the main Tesseract project. Alternatively, if this does not occur for the latest version of the Tesseract CLI, that indicates the issue has already been resolved, and we can update the dependencies we use for Tesseract.js.
Out of curiosity, do you know of any particular place where files with this format come from (aside from producing them on purpose in editing software)? I'm curious if this is a newer thing we should expect to see more of, or more of a niche format used only within particular applications.
from tesseract.js.
Hi @Balearica,
Thanks for your reply.
I got these images with Display P3 color space in our web application by importing images from the gallery on IOS devices (iphone 14 - IOS 16.2, iphone XR - IOS 14.4). One noticeable point is that by default, on IOS, the image taken from the camera would have HEIC type with Display P3 color space. When importing them to browsers (Safari, Chrome), they are automatically converted to JPEG. That's how I got JPEG images with Display P3 color space.
Regarding the point to verify in the main Tesseract project, since I have never run it before, it could be really complicated for me. Could you help me to reproduce this bug in that project? Thanks in advance.
from tesseract.js.
@hieunguyen2211 To clarify, does this mean that all photos taken with an iPhone/iPad (using default settings) do not work?
If you are not sure how to install/compile Tesseract, I can check that myself at some point this week.
from tesseract.js.
Hi @Balearica, I do not have a chance to test with iPad. "All photos taken with an iPhone using default settings do not work" -> correct!
from tesseract.js.
I looked into this further, and it looks like the color space is not the core issue, but rather the orientation metadata. This can be verified by checking the intermediate images (this example shows how to do this).
Unfortunately for developers, Apple does not actually rotate images depending on the orientation of your phone. Instead, it adds a metadata tag indicating the orientation, offloading the work of rotating the image onto the image viewer program. Some image processing programs have a step that recognizes this metadata and rotates the image, while others do not. Leptonica (the image processing library used by Tesseract) does not have a step for this.
The issue was presumably resolved when you saved as a different format as almost all image processing programs not created by Apple will save the image with the correct rotation so it can be viewed correctly by all programs without extra steps.
Tesseract.js does have code intended to detect orientation metadata and rotate images, however it must not be working in this instance. I will investigate further this week.
from tesseract.js.
Unfortunately it looks like there was a regression in our handling of images with orientation metadata. Notably, we did not have unit tests for this, so the fact that the feature was broken was not caught automatically. In #784 I fix the issue, as well as add unit tests for .jpeg images with 90/180/270 degrees of rotation specified in metadata, so if there are similar issues in the future we should catch them.
from tesseract.js.
Thanks a lot for your help. Could you give me some information about when the next release with this fix will be?
from tesseract.js.
I just give it a try and it worked as expected. Thanks in advance.
from tesseract.js.
Related Issues (20)
- Missing "languages" attributes on default export HOT 1
- Switch from CommonJS to ESM modules HOT 1
- setImage is re-run unnecessarily when rotateAuto is enabled
- `debug` output missing from types HOT 1
- Custom traindata do not work HOT 2
- possibility to capture stderr HOT 3
- JSDelivr CDN not accessible in China HOT 8
- Large images cause excessive memory usage
- Worker stuck on "loading language traineddata" HOT 4
- Updated types to infer output formats
- Inference of Chinese handwritten characters is bad HOT 3
- Add line size metrics (ascender, descender, size) to `line` objects in `blocks` output HOT 1
- Font attributes incorrect even when font is properly identified (`is_italic`, `is_serif`, etc.) HOT 1
- Focusing area HOT 1
- Multiple issues: Discussion
- Disable non-text output formats by default
- Tesseract - Running in Browser Console HOT 1
- Execution `worker.recognize` repeatedly causes "Out of Memory" error in JSFiddle HOT 5
- Error: Network error while fetching HOT 1
- how to use installed tessercat lib on windows for tesseract.js? 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 tesseract.js.