Skip to content

Constant error in .net framework app image resizing #253

Closed
@yauhenikh

Description

@yauhenikh

I have this method in my asp .net framework app for image resizing:

public static void SaveImageWithNewSize(int newWidth, string filePathName, string savePathName, int quality)
{
  using (var image = Image.NewFromFile(filePathName))
  {
    var scale = (double)newWidth / image.Width;
    var resized = image.Resize(scale);

    resized.WriteToFile(savePathName, new VOption
    {
      {"Q", quality}
    });
  }
}

And I always get error
NetVips.VipsException: unable to call VipsForeignSaveJpegFile
{savePathName}: unable to open for write
system error: Invalid argument

When I use other image libraries (magick.net, system.drawing, skiasharp etc.) in the similar method, there are no errors, resizing is working.
But I want to try netvips library.

Can you help me?
Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions