Page 1 of 1

How to setup nconvert for use on MacOS Catalina [Solved]

Posted: Sat Apr 29, 2023 9:05 am
by mgegersdorfer
I've been at it for a week now. I can't figure it out. what am I doing wrong?

I tried the below before & after adding environment variable.
environment methods used were from the following links. used "env" after restarting Terminal to confirm. All methods worked for me.
https://support.apple.com/en-au/guide/t ... 006f8f/mac
https://stackoverflow.com/questions/655 ... s-catalina
https://apple.stackexchange.com/questio ... s-catalina
set my environment variables as follows;
echo 'export nconvert=/Users/matthew/NConvert/nconvert' >> ~/.zshev
echo 'export nconvert=/Users/matthew/NConvert/' >> ~/.zshev

I've tried the following.
  • nconvert -wmopacity 7 -wmflag center -wmsize 98 -wmfile "/Users/uName/Desktop/Watermark/Watermark.png" "/Users/uName/Desktop/Test/Web/TTK_VW06 b.jpg"
  • ./nconvert -wmopacity 7 -wmflag center -wmsize 98 -wmfile "/Users/uName/Desktop/Watermark/Watermark.png" "/Users/uName/Desktop/Test/Web/TTK_VW06 b.jpg"
  • "/Users/uName/NConvert/nconvert" -wmopacity 7 -wmflag center -wmsize 98 -wmfile "/Users/uName/Desktop/Watermark/Watermark.png" "/Users/uName/Desktop/Test/Web/TTK_VW06 b.jpg"
I keep getting the error message:
"zsh: command not found: nconvert"

I'm more a graphics designer with some coding knowledge. What I deduce is that the "zsh" shell, does not recognize the command "nconvert". probably need to set "nconvert" so it can recognize it as a command. Even though the environment variable is set it most likely needs to be set some place else or there is another way to set environment variables for command line apps.

Re: Help with nconvert on MacOS Catalina

Posted: Sat Apr 29, 2023 12:51 pm
by mgegersdorfer
This command Is correct however I needed to "CD" into the dir where "nconvert" is located for it to work.
  • ./nconvert -wmopacity 7 -wmflag center -wmsize 98 -wmfile "/Users/uName/Desktop/Watermark/Watermark.png" "/Users/uName/Desktop/Test/Web/TTK_VW06 b.jpg"
I now see what looks like confirmation that nconvert is receiving input.

** NCONVERT v7.136 (c) 1991-2022 Pierre-E Gougelet (Jan 26 2023/09:46:46) **
Version for MacOS X (All rights reserved)
** This is freeware software (for non-commercial use)

Unfortunately I now get the following error message;
my_error_exit...<JPEG parameter struct mismatch: library thinks size is 632, caller expects 600>
my_error_exit...<JPEG parameter struct mismatch: library thinks size is 632, caller expects 600>
my_error_exit...<JPEG parameter struct mismatch: library thinks size is 632, caller expects 600>
my_error_exit...<JPEG parameter struct mismatch: library thinks size is 632, caller expects 600>
Error: Don't know how to read this picture (/Users/uName/Desktop/Test/Web/TTK_VW06 b.jpg)

This is a bit of an annoyance because I need to pass this code from a script to "nconvert"

I now have two questions:
  • How do I resolve the above error?
  • How do I pass this command from a script without needing to run CD first or how do I implement CD in one pass together with the nconvert command?

Re: Help with nconvert on MacOS Catalina

Posted: Sat Apr 29, 2023 1:13 pm
by cday
You'll probably have to wait for Pierre for an answer, but have you tried a simpler action than watermark, and maybe a different source file format?

Re: Help with nconvert on MacOS Catalina

Posted: Sat Apr 29, 2023 2:16 pm
by mgegersdorfer
It worked for a tif image, no problem. It came back with "OK" and a photo with watermark is produced.
  • nconvert -wmopacity 7 -wmflag center -wmsize 95 -wmfile "/Users/uName/Desktop/Watermark/Watermark.png" "/Users/uName/Desktop/Test/Print/TTK-AL01 a.tif"
The command below produces the same error message as before(I think maybe the jpeg plugin aint being referenced);
  • nconvert -wmopacity 7 -wmflag center -wmsize 95 -wmfile "/Users/matthew/Desktop/Watermark/Watermark.png" "/Users/matthew/Desktop/Test/Web/TTK-AL01 a.jpg"
  • nconvert -ratio -rtype lanczos -resize 50% 50% "/Users/matthew/Desktop/Test/Web/TTK-AL01 a.jpg"
I'm using the standalone "nconvert" copied into "/Applications/NConvert". I do have XnViewMP installed but was not able to find nconvert. I also tried XnConvert was a failed attempt.

Re: Help with nconvert on MacOS Catalina

Posted: Sat Apr 29, 2023 2:28 pm
by cday
You could maybe report the XnConvert bug with steps to reproduce and if possible test file(s) as that should be easy to describe clearly, and also cross-reference this thread.

Re: Help with nconvert on MacOS Catalina

Posted: Sat Apr 29, 2023 2:33 pm
by mgegersdorfer
RESOLVED! How do I pass this command from a script without needing to run CD first or how do I implement CD in one pass together with the nconvert command?

I realized I incorrectly declared the environment variable earlier.
I was declaring it as follows. I did not add it to the "PATH", which I was supposed to do. I was overthinking it!
echo 'export nconvert=/Users/matthew/NConvert/' >> ~/.zshev

The following is the correct procedure:
  • Download the standalone "nconvert" and extract it.
  • Copy/Move the "NConvert" folder to a directory of your choice(I used "/Applications")
  • Set the environment variable as follows(changing "/Applications/NConvert" to the folder of your choice. keep the "PATH" or it will not work):
    echo 'export PATH=/Applications/NConvert' >> ~/.zshenv
I can now use the "nconvert", without "CD"ing to the dir and without "./" at the beginning of "nconvert"

Re: Help with nconvert on MacOS Catalina

Posted: Sat Apr 29, 2023 2:53 pm
by cday
mgegersdorfer wrote: Sat Apr 29, 2023 2:33 pm How do I pass this command from a script without needing to run CD first or how do I implement CD in one pass together with the nconvert command?
I am sorry, I am not a Mac user, only very basic Windows scripting with an aspiration when I have time to be able to script in my now much-preferred Linux! :wink:

Re: Help with nconvert on MacOS Catalina

Posted: Sat Apr 29, 2023 2:54 pm
by mgegersdorfer
cday wrote: Sat Apr 29, 2023 2:28 pm You could maybe report the XnConvert bug with steps to reproduce and if possible test file(s) as that should be easy to describe clearly, and also cross-reference this thread.
This is not an XnConvert bug. I don't have this issue with XnConvert nor XnViewMP. Did you mean I should report this bug over in a another thread because nconvert does not have a dedicated Bug Report Thread? If that was the case, then did you mean the Bug Report thread for XnViewMP thread? because I don't see a dedicated Bug Report thread for XnConvert either.

Re: Help with nconvert on MacOS Catalina

Posted: Sat Apr 29, 2023 2:57 pm
by mgegersdorfer
cday wrote: Sat Apr 29, 2023 2:53 pm
mgegersdorfer wrote: Sat Apr 29, 2023 2:33 pm How do I pass this command from a script without needing to run CD first or how do I implement CD in one pass together with the nconvert command?
I am sorry, I am not a Mac user, only very basic Windows scripting with an aspiration when I have time to be able to script in my now much-preferred Linux! :wink:
Not to worry I resolved this issue :D :wink: :D