Bug Report: JPEG error in MacOS version of NConvert [Solved]

Discussions on NConvert - the command line tool for image conversion and manipulation

Moderators: XnTriq, helmut, xnview

mgegersdorfer
Posts: 9
Joined: Sat Apr 29, 2023 7:52 am

Bug Report: JPEG error in MacOS version of NConvert [Solved]

Post by mgegersdorfer »

Converting from PNG/TIF image to JPEG produces the following error:
  • Error: In JPEG (.../Sample.jpg)
*The desired output image format needs to be JPEG.
*It does produce a .jpg file. However, there is no information in it. The file size is 0.
*I've attached sample files for anyone wanting to try.
*I don't know how to change the Color Profile with the ICC commands. So I've omitted it from this topic.
*Where it states ".../Sample.tif" I used my fully qualified path name. Substitute it with your own.


System Specs:
  • iMac Early 2009 with a pached copy of macOS Catalina.
  • Processor: 2.66 GHz Intel Core 2 Duo.
  • Memory: 8 GB 1333 MHz DDR3.
  • Graphics: NVIDIA GeForce 9400 256 MB.
  • Model Identifier: iMac9,1.
I need to be able to save TIF to JPEG with the following criteria:
  • DPI: 72.
  • Image Size: 800 longest side.
  • Canvas Size: 800x800
  • Canvas Background Color: White.
  • Color Profile: sRGB IEC61966-2.1
Tried saving the photo to JPEG with the following code. Unsuccessful:

Code: Select all

nconvert -dpi 72 -ratio -rtype linear -resize longest 800 -canvas 800 800 center -bgcolor 255 255 255 -wmopacity 10 -wmflag center -wmsize 95 -wmfile ".../Watermark.png" -out jpeg -q 90 ".../Sample.tif" 
*I get the same error when using single quotes.
*I get the same error when using a PNG image as input.
*I get the error "can't open file" when using colons in the Pathname (Does not use HFS File Paths).
*This works on my Windows 11 Platform with one hiccup. The background color is Black no matter the value I set it :( ).


Tried saving the photo to JPEG with the following simpler code. Unsuccessful:

Code: Select all

nconvert -resize longest 800 -out jpeg -q 90 ".../Sample.tif"
*The above gave me the same error message "Error: In JPEG (.../Sample.jpg)"
*I get the same error when using a PNG image as input.


Tried saving a watermark directly on top of a JPEG image with the following code. Unsuccessful:

Code: Select all

nconvert -wmopacity 7 -wmflag center -wmsize 98 -wmfile ".../Watermark.png" ".../Sample.jpg"
It gave me the below 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 (.../Sample.jpg)
Tried saving the photo to PNG with the following code. Progress: :? (Unfortunately, the background is still black :( )

Code: Select all

nconvert -dpi 72 -ratio -rtype linear -resize longest 800 -canvas 800 800 center -bgcolor 255 255 255 -wmopacity 10 -wmflag center -wmsize 95 -wmfile ".../Watermark.png" -out png ".../Sample.tif"
*Unfortunately, PNG images are not the final goal. It has to be in JPEG format.

I Also thought there might be something wrong with the plugins provided with nconvert.
I deleted all the Plugins in the plugin folder which came with nconvert. Then, I opened the "Show Package Contents" of the XnViewMP Application installed on the mac and copied all it's plugins into the Plugin folder with nconvert. Unfortunately, when running the code again. The same error message is produced!

Anyone know how to resolve this or am I correct to assume that this is a bug?
Reference: How to setup nconvert for use on MacOS Catalina
You do not have the required permissions to view the files attached to this post.
Last edited by mgegersdorfer on Fri May 05, 2023 6:24 pm, edited 1 time in total.
mgegersdorfer
Posts: 9
Joined: Sat Apr 29, 2023 7:52 am

Re: Bug Report: JPEG error in MacOS version of NConvert

Post by mgegersdorfer »

I confirm this error persists on my Work iMac.
Specs: iMac 2019 edition with a non patched macos Catalina, 27" Screen.
User avatar
xnview
Author of XnView
Posts: 43607
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Bug Report: JPEG error in MacOS version of NConvert

Post by xnview »

Please try to download the package again, i've fixed the build problem...
Pierre.
mgegersdorfer
Posts: 9
Joined: Sat Apr 29, 2023 7:52 am

Re: Bug Report: JPEG error in MacOS version of NConvert

Post by mgegersdorfer »

xnview wrote: Fri May 05, 2023 8:45 am Please try to download the package again, i've fixed the build problem...
Resolved: Awesome! It's fixed now. :D