Question to NConvert and Windows Short-Filenames

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

Moderators: XnTriq, helmut, xnview

herb
Posts: 271
Joined: Sat Jul 18, 2009 3:19 pm

Question to NConvert and Windows Short-Filenames

Post by herb »

Hello Pierre,

My application tries to convert *.heic or *.avif images to *.jpg images.
Because my application has also to work for names that contain Unicode-characters, it always uses the windows short-filenames.
The response from NConvert is always: Error: Don't know how to read this picture

So I tried to reproduce this behaviour in DOS-box (== cmd.exe)
In the following you will see the results for a *.heic file:
(The used short windows-filename is the proper one)
- using the windows standard-filename

Code: Select all

C:\Fototools\NConvert>C:\FOTOTOOLS\NConvert\nconvert.exe -half_res -ignore_errors -thumb 1920 1920 -overwrite -out jpeg -o C:\Users\\herb\AppData\Local\Temp\AUTUMN_2900_1_prvws.jpg F:\WORK_EIXM\BILDFORMATE\Heic\autumn_1440x960.HEIC
** NCONVERT v7.172 (c) 1991-2024 Pierre-E Gougelet (Feb 19 2024/14:50:40) **
        Version for Windows 7/8/10/11 x64  (All rights reserved)
** This is freeware software (for non-commercial use)

Conversion of F:\WORK_EIXM\BILDFORMATE\Heic\autumn_1440x960.HEIC into C:\Users\\herb\AppData\Local\Temp\AUTUMN_2900_1_prvws.jpg OK
and unsing the windows short-filenames

Code: Select all

C:\FOTOTO~1\NConvert\nconvert.exe -half_res -ignore_errors -thumb 1920 1920 -overwrite -out jpeg -o C:\Users\herb\AppData\Local\Temp\AUTUMN~1_2900_1_prvws.jpg F:\WORK_E~1\BILDFO~1\Heic\AUTUMN~1.HEI
** NCONVERT v7.172 (c) 1991-2024 Pierre-E Gougelet (Feb 19 2024/14:50:40) **
        Version for Windows 7/8/10/11 x64  (All rights reserved)
** This is freeware software (for non-commercial use)

  Error: Don't know how to read this picture (F:\\WORK_E~1\\BILDFO~1\\Heic\\AUTUMN~1.HEI)
How can this problem be solved?
Thanks in advance
Best regards
herb
cday
XnThusiast
Posts: 4053
Joined: Sun Apr 29, 2012 9:45 am
Location: Cheltenham, U.K.

Re: Question to NConvert and Windows Short-Filenames

Post by cday »

Doesn't NConvert now support Unicode, as indicated in this 08 Sep 2023 post relating to v1.155?
User avatar
xnview
Author of XnView
Posts: 44034
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Question to NConvert and Windows Short-Filenames

Post by xnview »

Try the unicode version
Pierre.
herb
Posts: 271
Joined: Sat Jul 18, 2009 3:19 pm

Re: Question to NConvert and Windows Short-Filenames

Post by herb »

Hello,

thanks for your replies and hints.
Of course I will give the unicode version a try.

But are you really sure that this version will support windows short-filenames.

Because the current version of NConvert works properly for * jxl and also *.gpr images, but not for *.avif or *.heic,
I think the problem will be caused by the file-extension which is longer than 3.

I kindly ask Pierre to start a (short) investigation in order to clarify this.
Thanks in advance
Best regards
herb
herb
Posts: 271
Joined: Sat Jul 18, 2009 3:19 pm

Re: Question to NConvert and Windows Short-Filenames

Post by herb »

Hello,

in meantime I did some tests with NConvert_unicode v7.172 using *.avif images.
My observations are:
- also the unicode version does not support Windows short-filenames for *.avif
- it does not support Windows long-filenames that contain unicode surrogates.

My question to Pierre still is:
Please do a short investigation whether the 4-character-file-extesnion causes the problem to not support Windows short-filenames.

Thanks in advance
Best regards
herb
User avatar
xnview
Author of XnView
Posts: 44034
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Question to NConvert and Windows Short-Filenames

Post by xnview »

herb wrote: Sun Jun 23, 2024 7:08 am Because the current version of NConvert works properly for * jxl and also *.gpr images, but not for *.avif or *.heic,
Standard package of NConvert v7.172?
Pierre.
herb
Posts: 271
Joined: Sat Jul 18, 2009 3:19 pm

Re: Question to NConvert and Windows Short-Filenames

Post by herb »

Hello Pierre,

thanks for your reply.
The test were done with
- NConvert version 7.172
- all plugins copied from XnViewMP 1.7.2 plugins folder (except libJPEGXL.dll, which is out of interest for *.avif images)

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

Re: Question to NConvert and Windows Short-Filenames

Post by xnview »

herb wrote: Wed Jun 26, 2024 2:34 pm - NConvert version 7.172
- all plugins copied from XnViewMP 1.7.2 plugins folder (except libJPEGXL.dll, which is out of interest for *.avif images)
with default package (no dll from XnView MP), i have no issue to load HEIC or AVIF files
Pierre.
herb
Posts: 271
Joined: Sat Jul 18, 2009 3:19 pm

Re: Question to NConvert and Windows Short-Filenames

Post by herb »

Hello Pierre,

thanks for your investigations.
As you requested, I repeated my tests with NConvert v1.172 and plugins only from the *.zip file that contains NConvert.exe

The result is identical to my previous tests: Windows short-filenames do not work.

I have seen that the above given plugin-directory does not contain any *avif* dll I suppose that heif.dll is used for reading.
heif.dll: 24.9.2023 with 589 KB

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

Re: Question to NConvert and Windows Short-Filenames

Post by xnview »

could you send me test files + bat to reproduce?
Pierre.
User avatar
xnview
Author of XnView
Posts: 44034
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Re: Question to NConvert and Windows Short-Filenames

Post by xnview »

ok, i see. If you use NConvert unicode, parameters doesnt support short windows filename, it's normal.
you can't get long filename before to call NConvert?
Pierre.
herb
Posts: 271
Joined: Sat Jul 18, 2009 3:19 pm

Re: Question to NConvert and Windows Short-Filenames

Post by herb »

Hello Pierre,

thanks for your reply.
If you use NConvert unicode, parameters doesnt support short windows filename, it's normal.
Why is this normal?
I think the usage of short filenames should be transparent to an application.
you can't get long filename before to call NConvert?
In the workflow of my application >1 other applications are used.
As only some of them support unicode-filenames I decided to work with the Windows short-filename.
I don't have problems with it.

Now with NConvert we have a new situation - as far as I suggest - because of the 4 character long file-extension, which will be shorted as part of the short-filename to 3 characters.
Also using the unicode-version of NConvert does not solve my problem.
Yes this version supports many unicode names, but a filename that contains surrogates does not work.

Please allow also a question:
Could you see why NConvert gives an error message for *.avif files (using the short-filename)
- is it a decision by NConvert itself or
- is it because the plugin gives back a negative response for one call?

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

Re: Question to NConvert and Windows Short-Filenames

Post by xnview »

ok, i can add a fix for this case. Please try this version?
Pierre.
herb
Posts: 271
Joined: Sat Jul 18, 2009 3:19 pm

Re: Question to NConvert and Windows Short-Filenames

Post by herb »

Hello Pierre,

thanks for the latest NConvert version 7.182. Great job.
It supports also surrogates as far as I have seen.

For the following filetypes: *.avif, *.heic, *.jxl, *.jxr, *.jp2 (and also *.gpr)
I created 4 files with names that contain
- only Ascii characters
- Ascii and chinese characters (no surrogates)
- Ascii, chinese and surrogate characters
- Ascii, chinese, surrogate and emoji characters (which I suggest are also surrogates)

Using the windows filename (instead of short-filename) NConvert worked properly for all these files.
Thanks for the correction/enhancement.

Please release this "private" version very soon.

Thanks in advance
Best regards
herb