-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Classify HEIC/HEIF images #233
Comments
jimp-dev/jimp#771 (comment) suggests that |
I sure hope this is something we can see being added in a future update, most phones support it at this time and some even have it on by default like mine! I actually forgot about it and have a lot of unrecognized pictures now :( |
I would love to get heic support as well. I understand that I can convert my heic pictures to jpeg - but I prefer to keep them in their original format. Also, thanks for a great app! |
Even a temporary fix would be good for now I would say. |
@marcelklehr I really need this since I exclusively use HEIC, so I'm willing to implement it and send a PR. Do any of these solutions sound good to you?
|
I would be a bit wary of using pre generated images since we've no control over them (e.g. the max size can be configured by the user, which might not be enough for us). Plus it introduces a weird dependency and the conversion isn't too much effort compared to running the actual inference. It will probably solve the OOM issue. Let me take another look and send a PR for this. EDIT: looks like I'll use the preview generator after all, but not the pre-generated images |
My heic photos have worked since installing and configuring the imagick stuff, can't confirm if that is just previews or not.. As a hacky solution, it would probably indeed be easier to take heic > convert to jpeg > show (and perhaps cache for a short while) heic as jpg, leaving all else intact and untouched. |
That's not hacky. We need to ultimately convert every image to bitmap for inference anyway; this is just the pipeline. |
Would it be possible to follow the preview generation in the choice of the conversion tool? That would mean no additional dependencies and the code could probably be reused. imagick has always been plagued by security issues, which is why NC is providing an alternative now and it would be great if recognize did the same. |
I don't think it uses imagick anymore #479 |
@pulsejet Oh, that's good to hear. Then it's even more important to not reintroduce it here, imo :) |
This issue is already solved... |
@pulsejet After looking at the PR you linked, I have to contradict: They are using the NC preview provider, which in turn can use imagick, depending on it's configuration. |
Oh, I see... How was it solved, though? With or without imagick and in the latter case, did it introduce imagick as a hard dependency for recognize? |
AFAIK recognize just uses the preview generator for clarssification now, so it can classify any image that can have preview generated with an appropriate provider. If imaginary is installed, it'll use that. So as such, any further dependency on imagick doesn't belong to this repo (but server). |
@theCalcaholic Sorry, I never came back and closed this issue. (I had not upgraded to NC25 for a while so I hadn't seen the new features until I got recognize 3.) It should have been closed back when #365 was merged in October, and any dependence on ImageMagick introduced in #365 was removed in #479 in November. |
@pulsejet Thanks again for implementing this! |
@marcelklehr for most of it 😄 |
@pulsejet and @kc9jud |
One further clarification: If I understand correctly, it's still possible that if you configure NC to use ImageMagick for preview generation, Recognize will indirectly call ImageMagick. Of course, we don't have any control over that here -- that's all upstream of us. |
Describe the bug
Recognize does not ahem recognize HEIC/HEIC files as images.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
HEIC/HEIF images should be tagged, just as if they were JPEG/PNG/BMP/etc.
Recognize (please complete the following information):
Server (please complete the following information):
Additional context
This line https://github.com/marcelklehr/recognize/blob/dc02e60ab7a24e0ddb7b484ac1e287cc181a1ccd/lib/Service/ImagesFinderService.php#L16 sets the list of formats.
Is addingOr does some conversion need to be done before calling the classifier nets?'image/heic'
sufficient?According to jimp-dev/jimp#771, Jimp doesn't currently support HEIC/HEIF. A call to ImageMagick may be needed to do the conversion.
The text was updated successfully, but these errors were encountered: