News for hackers. Stuff that matters.
Re:Calipers: The Fastest Way to Measure Image Dimensions in ... by guepe on Friday October 02, 2015 @02:44PM (#10320438)
Maybe I missed something on the methodology, but I have a question regarding justification of designing a complete new tool.

The article mentions "ImageMagick is slow because it does a lot more than just extract image size". So we implemented a complete new solution.

How about: "We added to ImageMagick a new command to just extract image size". So we published a small patch to Imagemagick, and got it done much faster than creating a complete new tool. On top of that, reusing tested Imagemagick data structure would probably reduce a lot maintenance cost.

Maybe I did not see some subtleties ?

Re:Calipers: The Fastest Way to Measure Image Dimensions in ... by mgartner on Friday October 02, 2015 @02:54PM (#10320496)
The overhead of shell calls in Node was a big reason why we avoided trying to patch ImageMagick or other command line program.
Re:Calipers: The Fastest Way to Measure Image Dimensions in ... by ilurkedhere on Friday October 02, 2015 @03:40PM (#10320791)
How bad is it when you call info ImageMagick's library via FFI?
Re:Calipers: The Fastest Way to Measure Image Dimensions in ... by mkoryak on Friday October 02, 2015 @02:53PM (#10320491)
this is written entirely in javascript. If all you need is to get an image size, then installing imagemagick is overkill
Re:Calipers: The Fastest Way to Measure Image Dimensions in ... by guepe on Friday October 02, 2015 @03:22PM (#10320650)
I see. So this is a "fast javascript implementation to retrieve size of {image, pdf}" And since process is a small task with many calls, it would be costly to call an external process (imagemagik) using native code.
Re:Calipers: The Fastest Way to Measure Image Dimensions in ... by mkoryak on Friday October 02, 2015 @02:44PM (#10320436)
inspired by https://github.com/netroy/image-size

which has sync and async methods, supports more image types, but doesnt let you measure pdfs (which requires an external lib here).