Comments (10)
Do you mean that findimagedupes terminates? (eg. if you feed it that file followed by two others, it does not reach the other two?)
It looks like newer versions of graphicsmagick do not have this issue (eg. Ubuntu 22.04, debian sid) but I'll see if I can emulate it and improve findimagedupes' behaviour in this situation.
Thank you for the report.
from findimagedupes.
Yes, it interrups in an unclean way as soon as it tries to read that old WMF file.
I am not sure if this should be fixed in GraphicsMagick or just handled here, so I reported it also on GM issues tracker:
https://sourceforge.net/p/graphicsmagick/bugs/724/
Thanks!
from findimagedupes.
Given that Ubuntu and debian don't crash (1.4+really1.3.38-1ubuntu0.1 and 1.4+really1.3.41-1) I would guess the graphicsmagick end is already fixed in more recent versions.
The initial point of the try code was to catch misbehaviour of imagemagick (which was used before the switch to graphicsmagick), so if it isn't doing the job it was intended for, it certainly needs to be sorted. Belt and braces, and all that.
from findimagedupes.
please test for me:
- copy
findimagedupes
somewhere (sayfid
) - edit the new program and immediately after the
eval
line add:
use sigtrap qw( die any );
- create a copy of the bad wmf file under a new name (say
bad1.wmf
andbad2.wmf
) - create a copy of a good file (say
good1.jpg
andgood2.jpg
) - run the new program as
./fid bad1.wmf good1.jpg bad2.wmf good2.jpg
Does the program output that good1 and good2 match as well as warning about bad1 and bad2 ?
from findimagedupes.
Just checked the latest code from GraphicsMagick and effectively it closes down way more gracefully than before. See the comment here: https://sourceforge.net/p/graphicsmagick/bugs/724/#ca22
Trying what you suggested, using the installed GraphicsMagick version (the one that still have this abrupt exit when it detect an unavailable font) the fid
file looks like:
my $result = eval {
use sigtrap qw( die any );
if ((mimetype($file)||'') =~ /^(audio|video)/) {
and the result, using images from https://telparia.com/fileFormatSamples/image/wmf/ on BASH is:
$ ./fid MINN.XK4 MOUNTAIN.WMF MINN2.XK4 MOUNTAIN2.WMF
Aborted (core dumped)
and on ZSH is:
$ ./fid MINN.XK4 MOUNTAIN.WMF MINN2.XK4 MOUNTAIN2.WMF
[1] 20832 IOT instruction (core dumped) ./fid MINN.XK4 MOUNTAIN.WMF MINN2.XK4 MOUNTAIN2.WMF
Anyway, the version of GraphicsMagick that I have installed is also the 1.3.41, as on Ubuntu. The libwmf I have installed is 0.2.13 while on Ubuntu you should have the 0.2.12. So maybe it is failing for me and not for you because you have the needed font installed (Times-Roman) and I don't have it?
from findimagedupes.
Most peculiar.
I see from your other thread that you are using archlinux.
I set up an archlinux container and can now at least partially replicate.
I'll see if I can work out what's going on.
from findimagedupes.
Thanks!
It is actually possible that the issue is triggered by some compilation flags used in the packaging on Arch.
from findimagedupes.
Yes, it seems highly likely there are differences.
If I disable stderr redirection, then for findimagedupes foo MINN.XK4 foo
I see on archlinux:
imagemagick problem: Exception 430: Unable to open file (foo)
perl: magick/draw.c:1777: DrawSetFont: Assertion `font_name != (const char *) NULL' failed.
Aborted
but on Ubuntu, I see:
imagemagick problem: Exception 430: Unable to open file (foo)
imagemagick problem: Exception 405: Unable to read font (/usr/share/fonts/type1/gsfonts/n021003l.pfb)
imagemagick problem: Exception 430: Unable to open file (foo)
It's the assertion failure that's causing the problem. Having not thought about it very hard, I hadn't realised that graphicsmagick is actually part of the perl process rather than being something called by it. Once graphicsmagick sends the abort signal, I don't think there's anything that can be done. When I wrote the code, I assumed the eval
protected the program but it doesn't in this situation. I'll see if there's any good workaround.
from findimagedupes.
I haven't found a simple fix for this although one may well exist.
An alternative to trying find a way to block the signal would be to separate graphicsmagick processing into a separate worker process. This would make it harder for graphicsmagick to inadvertently kill findimagedupes.
I'll see if I can implement this in a way that is not too expensive.
A potential free bonus if it works out is parallelising fingerprinting (#9)
from findimagedupes.
Nice!
In the process, did you understand why on Ubuntu has a different behaviour than on Arch?
If we get this, maybe we can fix the Arch PKGBUILD script or the graphicsmagick source...
from findimagedupes.
Related Issues (20)
- option: only equal size? HOT 2
- HEIC Support - iPhone Pictures HOT 4
- honour EXIF Orientation HOT 2
- Concurrent access to fingerprint DB HOT 3
- Sort output by Size HOT 1
- suggest print out each filename in different line HOT 1
- Option not to waste diskspace on merged fingerprint database HOT 3
- how to install findimagedupes on macOS? HOT 3
- Enable (tune?) parallelism HOT 1
- merge database may lose entries on fingerprint mismatch HOT 1
- findimagedupes --help errors HOT 3
- Is it possible to print the AMOUNT of similarity along with similar files? HOT 4
- how i can extract the results in a csv or text file, with every similar files separated with a new line? HOT 2
- request: findimagedupes can be used also for comparing similarity of videos HOT 1
- [HOWTO] Compare only one file to many HOT 7
- Creating fingerprints file based on folder followed by asterisk results in near empty file 12kB HOT 1
- Feedback about a few difficulties a newbie may face HOT 2
- Command syntax to list duplicates found in defined input folder and not duplicates within signature database/index HOT 2
- How to process the output files which paths contains spaces? The output can not be customized by the findimagedupes ? HOT 5
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 findimagedupes.