Crash with -keepcspace
Moderators: XnTriq, helmut, xnview
-
- Posts: 6
- Joined: Sat Feb 11, 2023 2:13 pm
Crash with -keepcspace
Command: "nconvert.exe -c 2 -overwrite -out jpeg -o ResultFile.jpeg -dpi 100 -keepcspace CMYK_31080x17275.JPG"
File:
CMYK 8-bit
31080x17275 px
DPI 200
Size 103 MB
OS Windows 10 64-bit
Don`t understand... Why does the nconvert.exe crash with this command?
If I use the same file with a lower resolution, it works well.
File that crashed:
https://www.dropbox.com/s/pusnyi8vwxgb4 ... 5.JPG?dl=0
File that works well:
https://www.dropbox.com/s/r4kshqu1tu4gj ... 5.JPG?dl=0
File:
CMYK 8-bit
31080x17275 px
DPI 200
Size 103 MB
OS Windows 10 64-bit
Don`t understand... Why does the nconvert.exe crash with this command?
If I use the same file with a lower resolution, it works well.
File that crashed:
https://www.dropbox.com/s/pusnyi8vwxgb4 ... 5.JPG?dl=0
File that works well:
https://www.dropbox.com/s/r4kshqu1tu4gj ... 5.JPG?dl=0
-
- XnThusiast
- Posts: 4136
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: nConvert crash with -keepcspace
I am not sure, but two comments on your code which may, or may not, have some relevance:Wae666 wrote: ↑Sat Feb 11, 2023 2:31 pmI don`t understand... Why does the nconvert.exe crash with this command?Code: Select all
"nconvert.exe -c 2 -overwrite -out jpeg -o ResultFile.jpeg -dpi 100 -keepcspace CMYK_31080x17275.JPG"
1. The quality of JPEG images is normally set using the -q option:
Code: Select all
-q value : JPEG/FPX/WIC/PDF/JPEG2K/WebP quality (default : 85)
Code: Select all
-c value : Compression number
default : 0 (uncompressed)
PDF : 1 (Fax), 2 (Rle), 3 (LZW), 4(ZIP), 5 (JPEG)
TIFF : 1 (Rle), 2 (LZW), 3 (LZW+Prediction)
4 (ZLIB)
5 (CCITT G3), 6 (CCITT G3-2D), 7 (CCITT G4) only B/W
8 (JPEG) only 24/32 bits
2. The -dpi option is used to set the resolution at which a PDF (for example) file is rasterised when opened using Ghostscript, I have never tested whether it can also be used to change the DPI of an image although the help file seems to indicate that:
Code: Select all
-dpi res_dpi : Set the resolution in DPI
-
- Posts: 6
- Joined: Sat Feb 11, 2023 2:13 pm
Re: Crash with -keepcspace
Simplified the command to:
"nconvert.exe -overwrite -out jpeg -o ResultFile.jpeg -keepcspace CMYK_31080x17275.JPG"
Unfortunately, using (or not using) flags "-c" and "-dpi" has no effect on crashes.
Only "-keepcspace", CMYK color space and file resolution are affected.
There are no problems with RGB.
"nconvert.exe -overwrite -out jpeg -o ResultFile.jpeg -keepcspace CMYK_31080x17275.JPG"
Unfortunately, using (or not using) flags "-c" and "-dpi" has no effect on crashes.
Only "-keepcspace", CMYK color space and file resolution are affected.
There are no problems with RGB.
-
- XnThusiast
- Posts: 4136
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Crash with -keepcspace
Are you by any chance using NConvert 32-bits?
If so, given the large pixel dimensions of your image and your comment that a lower resolution file converts correctly, you could test using the NConvert 64-bit version, in case the issue is the 32-bit software addressable memory limit.
If so, given the large pixel dimensions of your image and your comment that a lower resolution file converts correctly, you could test using the NConvert 64-bit version, in case the issue is the 32-bit software addressable memory limit.
-
- Posts: 6
- Joined: Sat Feb 11, 2023 2:13 pm
Re: Crash with -keepcspace
I am using the 64-bit version.
Also tried several versions of nconvert :
v6.56
v7.136
The result is the same
It seems to me that there is some limitation in the number of pixels for CMYK. About 2^29 px. But I don't know where to find information about it.
I experimented with files of this resolution:
[-] 38796*13911 = 539 691 156
[-] 31085*17279 = 537 117 715
[-] 38699*13876 = 536 987 324
[-] 31080*17276 = 536 938 080
[-] 38697*13875 = 536 920 875
[-] 31079*17276 = 536 920 804
[-] 26032*20625 = 536 910 000
[+] 40752*13175 = 536 907 600
[-] 31080*17275 = 536 907 000
[+] 38696*13875 = 536 907 000
[+] 43829*12250 = 536 905 250
[+] 32788*16375 = 536 903 500
[+] 13216*40625 = 536 900 000
[+] 31079*17275 = 536 889 725
[+] 31078*17275 = 536 872 450
[+] 31077*17274 = 536 824 098
[+] - success
[-] - crash
Also tried several versions of nconvert :
v6.56
v7.136
The result is the same
It seems to me that there is some limitation in the number of pixels for CMYK. About 2^29 px. But I don't know where to find information about it.
I experimented with files of this resolution:
[-] 38796*13911 = 539 691 156
[-] 31085*17279 = 537 117 715
[-] 38699*13876 = 536 987 324
[-] 31080*17276 = 536 938 080
[-] 38697*13875 = 536 920 875
[-] 31079*17276 = 536 920 804
[-] 26032*20625 = 536 910 000
[+] 40752*13175 = 536 907 600
[-] 31080*17275 = 536 907 000
[+] 38696*13875 = 536 907 000
[+] 43829*12250 = 536 905 250
[+] 32788*16375 = 536 903 500
[+] 13216*40625 = 536 900 000
[+] 31079*17275 = 536 889 725
[+] 31078*17275 = 536 872 450
[+] 31077*17274 = 536 824 098
[+] - success
[-] - crash
-
- XnThusiast
- Posts: 4136
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
-
- XnThusiast
- Posts: 4136
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Crash with -keepcspace
Both downloads open in XnView MP 64-bit but the crash file takes noticeably longer, what terminal output do you get running your NConvert code?
You do not have the required permissions to view the files attached to this post.
-
- Posts: 6
- Joined: Sat Feb 11, 2023 2:13 pm
Re: Crash with -keepcspace
I'm getting an allert from Windows.
"The program "nconvert.exe" is not working.
A problem has caused the program to stop working. Windows will close the program."
"The program "nconvert.exe" is not working.
A problem has caused the program to stop working. Windows will close the program."
-
- XnThusiast
- Posts: 4136
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Crash with -keepcspace
Do you get that alert quickly or after a reasonable delay -- could Windows possibly be assuming that as no output has been produced yet that NConvert has crashed?
I don't know how you could determine that, but opening the image in XnView MP 64-bit was very slow: do you have a faster computer, or could someone maybe test on a powerful computer?
I don't know how you could determine that, but opening the image in XnView MP 64-bit was very slow: do you have a faster computer, or could someone maybe test on a powerful computer?
-
- Posts: 6
- Joined: Sat Feb 11, 2023 2:13 pm
Re: Crash with -keepcspace
After entering a command in PowerShell, there is a delay of 1 minute. After that it crashes.
Latency is the same on my local PC as it is on the production server.
On the server there is a notification from Windows, on the local PC - no.
Latency is the same on my local PC as it is on the production server.
On the server there is a notification from Windows, on the local PC - no.
-
- XnThusiast
- Posts: 4136
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Crash with -keepcspace
And the approximate times for the smaller images that do convert, as the file size is increased do they increase to near 1 minute? If so, that would seem to suggest an arbitrary Windows time limit before conversion is assumed to have failed, wouldn't it?
-
- Posts: 6
- Joined: Sat Feb 11, 2023 2:13 pm
Re: Crash with -keepcspace
Most often I convert large files up to 45000x45000, it takes more than a minute and the process does not crash. But those files are RGB, so there is no problem with them.
I don't think the operating system limits nconvert's run time.
I don't think the operating system limits nconvert's run time.
-
- XnThusiast
- Posts: 4136
- Joined: Sun Apr 29, 2012 9:45 am
- Location: Cheltenham, U.K.
Re: Crash with -keepcspace
I give up...
Pierre ?
Pierre ?
-
- Posts: 1
- Joined: Sat Feb 11, 2023 7:42 pm
Re: Crash with -keepcspace
I got "Segmentation fault" message when I'm trying to convert problem image @ Win 10.
Tried same command on Linux: it gave me "Segmentation fault (core dumped)"
Probably developers could debug it with gdb
Tried same command on Linux: it gave me "Segmentation fault (core dumped)"
Probably developers could debug it with gdb
-
- Author of XnView
- Posts: 44589
- Joined: Mon Oct 13, 2003 7:31 am
- Location: France