[IMGREC-88] JPG image is not recognised by local or amazon Created: 21/Apr/20 Updated: 12/Dec/23 |
|
| Status: | Open |
| Project: | Image Recognition |
| Component/s: | None |
| Affects Version/s: | 1.2 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Neutral |
| Reporter: | Edwin Guilbert | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 3 |
| Labels: | maintenance | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Magnolia 6.2 |
||
| Attachments: |
|
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoD: |
[ ]*
Doc/release notes changes? Comment present?
[ ]*
Downstream builds green?
[ ]*
Solution information and context easily available?
[ ]*
Tests
[ ]*
FixVersion filled and not yet released
[ ] 
Architecture Decision Record (ADR)
|
| Bug DoR: |
[ ]*
Steps to reproduce, expected, and actual results filled
[ ]*
Affected version filled
|
| Date of First Response: | |
| Team: |
| Description |
|
When I try to recognise the following JPG image: 2020-04-21 11:57:47,414 ERROR nolia.ui.contentapp.browser.ActionExecutionService: An error occurred while executing action [recognize] info.magnolia.ui.api.action.ActionExecutionException: Action execution failed for action: recognize ... Caused by: com.machinezoo.noexception.WrappedException: javax.jcr.RepositoryException: Image format is not supported. Full exception: exception.txt This image doesn't work with either local or amazon recognition. |
| Comments |
| Comment by Marvin Boie [ 12/Dec/23 ] |
|
I also stumbled across it and took a closer look. There java.net.URLConnection#guessContentTypeFromStream is used to recognize the MimeType. This does not seem to work reliably for JPG. ImageInfo and Tika are able to recognize the image. I set a breakpoint in the image recognition call in java.net.URLConnection#guessContentTypeFromStream and then tried some methods via the IntelliJ debugger to get the MimeType:
I noticed that WEBP images are also not supported and that the method currently used to determine the MimeType returns something completely wrong:
The ImageInfo class which I use here cannot do WEBP either, which is also known under this ticket: https://jira.magnolia-cms.com/browse/MGNLIMG-335 Edit: Here is the JPG I encountered this bug with: This image is generated with the Microsoft Bing Image Creator Edit: I used Magnolia 6.2.40 and image-recognition 1.2.5 |