ad-si / Perspec

Scriptable desktop app to correct the perspective of images
https://feram.gumroad.com/l/perspec
GNU Affero General Public License v3.0
583 stars 32 forks source link

ImageMagick Failure on MacOS #5

Closed fralau closed 3 years ago

fralau commented 3 years ago

Hello, thanks for your work! This application is simple and should do the trick for me.

I installed it and followed the procedure. I get the following error in the window:

​dyld: lazy symbol binding failed: Symbol not found: _aligned_alloc
  Referenced from: /Applications/Perspec.app/Contents/Resources/imagemagick/lib/libMagickCore-7.Q16HDRI.7.dylib (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib
dyld: Symbol not found: _aligned_alloc
  Referenced from: /Applications/Perspec.app/Contents/Resources/imagemagick/lib/libMagickCore-7.Q16HDRI.7.dylib (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libSystem.B.dylib
Loaded file /my/dir/image.jpg (1536,1152)
Starting the app …
Target shape: (1283.667,802.22144)
Marked corners: ((157.2,76.8),(1444.8,68.4),(1436.4,892.80005),(157.2,856.80005))
Arguments for convert command:
/my/dir/image.jpg
-define
distort:viewport=1283.667x802.22144+0+0
-virtual-pixel
black
-distort
Perspective
157.2,76.8 0.0,0.0 157.2,856.80005 0.0,802.22144 1436.4,892.80005 1283.667,802.22144 1444.8,68.4 1283.667,0.0
+repage
/my/dir/image-fixed.jpg
perspec: callProcess: ./imagemagick/bin/convert "/my/dir/image.jpg" "-define" "distort:viewport=1283.667x802.22144+0+0" "-virtual-pixel" "black" "-distort" "Perspective" "157.2,76.8 0.0,0.0 157.2,856.80005 0.0,802.22144 1436.4,892.80005 1283.667,802.22144 1444.8,68.4 1283.667,0.0" "+repage" "/my/dir/image-fixed.jpg" (exit -6): failed

Perhaps you would see instantly what I need to do to fix this?

ad-si commented 3 years ago

Which of the 3 installation methods did you use? What version of macOS are you using? (Best you simply post the output from neofetch)

fralau commented 3 years ago

Thanks for the fast answer!

I used the brew cask install ad-si/tap/persp method, on OS X 10.14.6

$ magick -version
Version: ImageMagick 7.0.10-37 Q16 x86_64 2020-11-09 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(3.1)
Delegates (built-in): bzlib freetype gslib heic jng jp2 jpeg lcms lqr ltdl lzma openexr png ps tiff webp xml zlib
ad-si commented 3 years ago

Can you please install the latest nightly version frome here: https://github.com/ad-si/Perspec/actions/runs/356728632 (Just download and unzip the artifact). The version via brew might be broken. Let me know if it works, then I can make a new release tonight.

fralau commented 3 years ago

I did that (I got a file with date 10 November 22:40)

The error is slightly different this time:

​dyld: lazy symbol binding failed: Symbol not found: _objc_opt_class
  Referenced from:<snip>/Perspec.app/Contents/Resources/./perspec (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libobjc.A.dylib
dyld: Symbol not found: _objc_opt_class
  Referenced from: <snip>/Perspec.app/Contents/Resources/./perspec (which was built for Mac OS X 10.15)
  Expected in: /usr/lib/libobjc.A.dylib
<snip>/script: line 1: 21910 Abort trap: 6           ./perspec "$file"
ad-si commented 3 years ago

I still need to know:

What version of macOS are you using? (Best you simply post the output from neofetch)

ad-si commented 3 years ago

Ah dammit, you also need to fix the permissions when you install the nightly. Described here: https://github.com/ad-si/Perspec#macos

fralau commented 3 years ago

Ah, my bad for omitting that.

I just applied the access rights:

$ chmod +x \
>   ./Perspec.app/Contents/MacOS/Perspec \
>   ./Perspec.app/Contents/Resources/{perspec,script,imagemagick/bin/convert}

but unfortunately, I am still getting the same error.

ad-si commented 3 years ago

I'm repeating myself, but I still need to know:

What version of macOS are you using? (Best you simply post the output from neofetch)

🙈

fralau commented 3 years ago

OS X 10.14.6

ad-si commented 3 years ago

OS X 10.14.6

Well, I think that's the problem. I built it on 10.15. I just released a new version with an extra build for 10.14: https://github.com/ad-si/Perspec/releases/tag/v0.1.3.0 Does this work for you?

fralau commented 3 years ago

Yes it it worked ! Thanks a lot !

Just curious about what difference between the two versions of MacOS caused the bug ?

ad-si commented 3 years ago

Yes it it worked! Thanks a lot !

Awesome 😁. I'm glad we could finally figure it out!

Just curious about what difference between the two versions of MacOS caused the bug ?

Well, some code is compiled specifically for each OS during the build process and so they are not compatible. Probably something for OpenGL or GLFW.