Long filename crashes dzsave
See original GitHub issueUsing long filenames (>~230 characters) crashes the Image.Dzsave
method without an exception - it actually crashes the whole application without any warning or exception.
Example code:
using NetVips;
using var image = Image.NewFromFile("testImage.jpg");
string shortFileName = "short";
image.Dzsave(shortFileName);
Console.WriteLine("short success");
Directory.Delete(shortFileName + "_files", true);
string longFileName = "longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglonglong";
image.Dzsave(longFileName);
Console.WriteLine("long success");
Directory.Delete(longFileName + "_files", true);
Output:
> NetVipsPathBugDemo.exe
short success
** (process:14852): CRITICAL **: 13:26:48.876: gsf_outfile_new_child_full: assertion 'outfile != NULL' failed
** (process:14852): CRITICAL **: 13:26:48.878: gsf_outfile_new_child_full: assertion 'outfile != NULL' failed
** (process:14852): CRITICAL **: 13:26:48.879: gsf_output_write: assertion 'output != NULL' failed
** (process:14852): CRITICAL **: 13:26:48.879: gsf_output_close: assertion 'GSF_IS_OUTPUT (output)' failed
** (process:14852): CRITICAL **: 13:26:48.879: gsf_output_set_error: assertion 'GSF_IS_OUTPUT (output)' failed
** (process:14852): CRITICAL **: 13:26:48.879: gsf_output_error: assertion 'GSF_IS_OUTPUT (output)' failed
csrpoj:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NetVips" Version="2.2.0" />
<PackageReference Include="NetVips.Native.win-x64" Version="8.13.2" />
</ItemGroup>
<ItemGroup>
<None Update="testImage.tif">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Test image file:
Issue Analytics
- State:
- Created 10 months ago
- Comments:13 (11 by maintainers)
Top Results From Across the Web
DZ pyramid builder problem · Issue #527 · libvips ...
When running, it is creating the subdirectory stared at '17' down to '11' with the jpeg tiles inside, and then crashes. I'll try...
Read more >Long file paths crash File Explorer when accessing files on ...
The issue here is that File explorer crashes and restarts whenever browsing to a long path with a file that has a long...
Read more >net-vips
Using long filenames (>~230 characters) crashes the Image.Dzsave method without an exception - it actually crashes the whole application without any warning ...
Read more >Long File Name Crashes
Long File Name Crashes. Hi, I appreciate that there are a lot of queries regarding the file names exceeding 260 characters, but when...
Read more >Long file names crash IDEA
Every time I built the project, IDEA crashed. This is version 4.5 and Irida. No exceptions. No warnings. It just completely disappeared. What...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks for the hint to the zip container. I switched my application to using those, and yes, it solved the long file path issue, and is about 2x faster for me as well (at least my unit tests only take half as long).
NetVips v2.3.0 and NetVips.Native v8.14.2 is now available.