NConvert: JPEG XL convert fails with Exit code -1073740791

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

Moderators: XnTriq, helmut, xnview

mdnava
Posts: 19
Joined: Fri Mar 06, 2020 8:08 pm

NConvert: JPEG XL convert fails with Exit code -1073740791

Post by mdnava »

Hello!

NConvert is failing with exit code: -1073740791 whenever I try to convert/replace an image to JPEG XL

This is the command used (important: commands are generated by an automated tool, and all input files are JPEGs):

Code: Select all

$ nconvert.exe -rtype lanczos -out jpegxl -q 85 -D -overwrite "D:\path\to\folder\*.*"
The very same command works perfectly for jpeg and webp:

Code: Select all

$ nconvert.exe -rtype lanczos -out jpeg -q 85 -D -overwrite "D:\path\to\folder\*.*"
$ nconvert.exe -rtype lanczos -out webp -q 85 -D -overwrite "D:\path\to\folder\*.*"
However, if I save to a subfolder, then it works

Code: Select all

$ nconvert.exe -rtype lanczos -out jpegxl -q 85 -o "_workspace_\%.jxl" "D:\path\to\folder\*.*"
======================

In the making of this post I noticed a difference between the two commands, the one in the same folder and
the command to convert to a different folder, only the latter having the -o "%.jxl" params. So I did a test and
with the next command I was able to successfully convert the directory I was having the issue with:

Code: Select all

$ nconvert.exe -rtype lanczos -out jpegxl -q 85 -D -overwrite "D:\path\to\folder\*.*"
So, I cheered and I was about to erase all this text, but I did another test with the same command, on a different folder,
and again it failed with exit code -1073740791. The difference I can see is that the new folder has bigger JPEG photographs,
each about ~4MB and over 9000px wide.

But then I tried downsizing the same folder images using JPEG XL (to 6000px on its longest side) and it worked (twice):

Code: Select all

$ nconvert.exe -rtype lanczos -resize longest 6000 -rflag decr -out jpegxl -q 85 -o "_workspace_\%.jxl" "D:\path\to\folder\*.*"
So it seems NConvert cannot write JPEG XL with dimensions of around 8000px/9000px !?
And also, it seems like the {{ -o %.jxl }} flag is mandatory for JPEG XL even when overwriting/replacing, but not for other formats.

I'd appreciate any comments..

Best regards!
User avatar
xnview
Author of XnView
Posts: 45039
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: NConvert: JPEG XL convert fails with Exit code -1073740791

Post by xnview »

mdnava wrote: Fri Aug 09, 2024 5:03 am So, I cheered and I was about to erase all this text, but I did another test with the same command, on a different folder,
and again it failed with exit code -1073740791. The difference I can see is that the new folder has bigger JPEG photographs,
each about ~4MB and over 9000px wide.

But then I tried downsizing the same folder images using JPEG XL (to 6000px on its longest side) and it worked (twice):
Are you able to reproduce the problem on one file?
Pierre.
mdnava
Posts: 19
Joined: Fri Mar 06, 2020 8:08 pm

Re: NConvert: JPEG XL convert fails with Exit code -1073740791

Post by mdnava »

Hello Pierre, thank you for answering..
xnview wrote: Mon Aug 12, 2024 6:26 am Are you able to reproduce the problem on one file?
No, I tried exactly 5 times, with 5 different files (each over 8000px wide) and they all converted successfully to JPEG XL.

But then I tried converting five different series of images (each series also over 8000px wide):
» Two times the conversion was successful, but processor usage was abnormally high.. rare for NConvert.
» Three times it failed as it did before, NConvert started writting the first image and exited with code -1073740791

I'm gonna try to do some more testing before Friday to give more details.. I'm leaving town for a couple days.

Best regards..
mdnava
Posts: 19
Joined: Fri Mar 06, 2020 8:08 pm

Re: NConvert: JPEG XL convert fails with Exit code -1073740791

Post by mdnava »

Hello Pierre,

I have been trying unsuccessfully to replicate the reported issue over the past week.

It's very strange, it didn't happen just once, it was a constant issue when trying to convert very big images to JXL.

All I can think of at this time is that it could've been caused by something external, like Window Defender, or possibly
memory leak was happening. One thing that did change is that I restarted the system when I came back last week.

I'm sorry if it was a false flag in the end.

However, one thing that appears to happen 100% of the tests whenever I try to convert a list of big images (over 10000px)
to JPEG XL is that the system becomes unresponsive. Even though NConvert is doing the conversion, I don't think it
would be viable to use it for this purpose.

Best regards!
mdnava
Posts: 19
Joined: Fri Mar 06, 2020 8:08 pm

Re: NConvert: JPEG XL convert fails with Exit code -1073740791

Post by mdnava »

Hello Pierre!

I write to let you know I was able to replicate the issue when trying to convert some PNGs to JXL..
This is the command used:

$ nconvert.exe -rflag decr -out jpegxl -q 85 -no# -o "$\_workspace_\%.jxl" "E:\Photos\Kittens\__TT\*.*"

Now, the command seems to convert the first image successfully but then fails with Exit code -1073740791 when trying
to convert the next image. This happens with the original files, but when I remove all metada (with ExifTool)
the command works on those same images. Conversion seems to work to other formats, like jpeg.

Here are some image samples that should allow to replicate the issue.

ORIGINALS (they fail): https://drive.google.com/file/d/1KeIgVg ... p=drivesdk

EXIFTOOL METADATA REMOVED (they convert): https://drive.google.com/file/d/1RvDmqk ... p=drivesdk

By the way, the new JPEGLI format option, very good, very useful.. thank you for that!!

Best regards!
User avatar
xnview
Author of XnView
Posts: 45039
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: NConvert: JPEG XL convert fails with Exit code -1073740791

Post by xnview »

i have not the access
Pierre.
mdnava
Posts: 19
Joined: Fri Mar 06, 2020 8:08 pm

Re: NConvert: JPEG XL convert fails with Exit code -1073740791

Post by mdnava »

xnview wrote: Tue Nov 05, 2024 12:32 pm i have not the access
Sorry, first time I share thru Google Drive.
I've allowed access now.
User avatar
xnview
Author of XnView
Posts: 45039
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: NConvert: JPEG XL convert fails with Exit code -1073740791

Post by xnview »

i'm not able to reproduce with your sample files :(
Pierre.
mdnava
Posts: 19
Joined: Fri Mar 06, 2020 8:08 pm

Re: NConvert: JPEG XL convert fails with Exit code -1073740791

Post by mdnava »

xnview wrote: Thu Nov 07, 2024 2:47 pm i'm not able to reproduce with your sample files :(
Well I tried again locally and it worked.. honestly I don't know what's going on..
I was trying to take a screen capture but it works now..

Je suis désolé Pierre!, je laisse le problème de côté..

———————————————

On the other hand..
There seems to be another issue with RECURSION in NConvert, when there's more than one level depth..

Should I post this as a new forum entry .. !?

$ nconvert.exe recurse -rflag decr -out jpeg -q 85 -no# -o "$\_workspace_\%.jxl" "D:\mdnava\Workspace_L\20241107 TEST\*.*"

If there are multiple folders with images, they convert successfully.
-- folder1-with-imgs/
-- folder2-with-imgs/

But if there is multi lever recursion, there's a problem, as multiple subfolders are created for each image file
-- folder1/
---- subfolder1-with-imgs/
---- subfolder2-with-imgs/

-- folder2/
---- subfolder3-with-imgs/
---- subfolder4-with-imgs/

Result sample
-- folder1/
---- subfolder1-with-imgs/
------ subfolder1-with-imgs/imagename1-folder/imagename1-folder/imagename1.jpg
------ subfolder1-with-imgs/imagename2-folder/imagename2-folder/imagename2.jpg
------ subfolder1-with-imgs/imagename3-folder/imagename3-folder/imagename3.jpg
------ subfolder1-with-imgs/imagename4-folder/imagename4-folder/imagename4.jpg
------ subfolder1-with-imgs/imagename5-folder/imagename5-folder/imagename5.jpg
------ subfolder1-with-imgs/imagename6-folder/imagename6-folder/imagename6.jpg
------ subfolder1-with-imgs/imagename7-folder/imagename7-folder/imagename7.jpg
------ subfolder1-with-imgs/imagename8-folder/imagename8-folder/imagename8.jpg
---- subfolder2-with-imgs/
------ subfolder2-with-imgs/imagename1-folder/imagename1-folder/imagename1.jpg
------ subfolder2-with-imgs/imagename2-folder/imagename2-folder/imagename2.jpg
------ subfolder2-with-imgs/imagename3-folder/imagename3-folder/imagename3.jpg
------ subfolder2-with-imgs/imagename4-folder/imagename4-folder/imagename4.jpg
------ subfolder2-with-imgs/imagename5-folder/imagename5-folder/imagename5.jpg
------ subfolder2-with-imgs/imagename6-folder/imagename6-folder/imagename6.jpg
------ subfolder2-with-imgs/imagename7-folder/imagename7-folder/imagename7.jpg
------ subfolder2-with-imgs/imagename8-folder/imagename8-folder/imagename8.jpg

This becomes a huge problem when there are many image files..
cday
XnThusiast
Posts: 4210
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: NConvert: JPEG XL convert fails with Exit code -1073740791

Post by cday »

mdnava wrote: Fri Nov 08, 2024 1:20 am On the other hand..
There seems to be another issue with RECURSION in NConvert, when there's more than one level depth..

Should I post this as a new forum entry .. !?
Yes, absolutely, a new issue --> a new thread, is the only way to efficiently manage requests, to everyone's advantage... :D
mdnava
Posts: 19
Joined: Fri Mar 06, 2020 8:08 pm

Re: JPEG XL: PATHS longer than 135 characters FAIL

Post by mdnava »

Pierre, ça va!

I have noticed this issue with NConvert is actually happening for paths longer than 135 characters (only for JPEG XL).

So, this command fails:

Code: Select all

$ nconvert.exe -out jpegxl -q 85 -no# -D -overwrite "D:\userxx\OneDrive\Images\Wallpapers\Fiction-Series\Stargate Universe (2009-2011)\COPY FOLDER TO TEST\*.*"
Images inside that folder have paths with 141 characters and FAIL!, like for example:
D:\userxx\OneDrive\Images\Wallpapers\Fiction-Series\Stargate Universe (2009-2011)\COPY FOLDER TO TEST\Stargate Universe S01E01 010911 009.jpg

But, this command succeeds:

Code: Select all

$ nconvert.exe -out jpegxl -q 85 -no# -D -overwrite "D:\userxx\OneDrive\Images\Wallpapers\Fiction-Series\Stargate Universe (2009-2011)\COPY\*.*"
Images inside that second folder have paths with 126 characters and SUCCEED!, like for example:
D:\userxx\OneDrive\Images\Wallpapers\Fiction-Series\Stargate Universe (2009-2011)\COPY\Stargate Universe S01E01 010911 009.jpg

Then, the first command that failed, now works when converting to any other image format, like PNG, JPEGLI or WEBP, for example:

Code: Select all

$ nconvert.exe -out jpegli -q 85 -no# -D -overwrite "D:\userxx\OneDrive\Images\Wallpapers\Fiction-Series\Stargate Universe (2009-2011)\COPY FOLDER TO TEST\*.*"
That last command works with other formats, but not when using JPEG XL.. any path with >135 chars seems to fail.
I tried on a machine with Windows 10, on a VM with Windows Server 2019, and in a Windows Sandbox.. all same results.

Am I missing something.. ?

I'd appreciate any direction..
Best regards!