question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Long filename crashes dzsave

See original GitHub issue

Using 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: testImage

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
ax-meyercommented, Nov 25, 2022

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).

0reactions
kleisaukecommented, Mar 24, 2023

NetVips v2.3.0 and NetVips.Native v8.14.2 is now available.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found