Can't save this image taken from phone
rickbrew opened this issue · comments
I got this via e-mail this morning:
Hey,
I noticed that the WebP plugin that is included with latest Paint.net
versions fails to save images I have taken with my phone. I have no idea
what causes these images to fail specifically. It doesn't seem to be the
resolution because no matter how I resize the image it still fails.Trying to save such images as WebP seems to always result in a
"System.InvalidOperationException: data.Length must be in the range of
[1-4]." exception.Resaving the image as jpg will still fail, but resaving as another
format such as BMP and then saving as WebP works.I have attached a photo for testing if you can forward this to the
plugin developer.
Seems to be a metadata issue.
Here's the exception:
System.InvalidOperationException: data.Length must be in the range of [1-4].
at WebPFileType.Exif.ExifWriter.CreateIFDList(Dictionary`2 tags, Int64 startOffset)
at WebPFileType.Exif.ExifWriter.CalculateSectionOffsets()
at WebPFileType.Exif.ExifWriter.BuildIFDEntries()
at WebPFileType.Exif.ExifWriter.CreateExifBlob()
at WebPFileType.WebPFile.CreateWebPMetadata(Document doc)
at WebPFileType.WebPFile.Save(Document input, Stream output, Int32 quality, WebPPreset preset, Surface scratchSurface, ProgressEventHandler progressCallback)
at WebPFileType.WebPFileType.OnSaveT(Document input, Stream output, PropertyBasedSaveConfigToken token, Surface scratchSurface, ProgressEventHandler progressCallback)
at PaintDotNet.Data.FileTypeProxy.OnSave(Document input, Stream output, SaveConfigToken token, Surface scratchSurface, ProgressEventHandler callback) in D:\src\pdn\src\PaintDotNet\Data\FileTypeProxy.cs:line 69
at PaintDotNet.FileType.Save(Document input, Stream output, SaveConfigToken token, Surface scratchSurface, ProgressEventHandler callback, Boolean rememberToken) in D:\src\pdn\src\Data\FileType.cs:line 282
at PaintDotNet.Dialogs.SaveConfigDialog.<>c__DisplayClass48_0.<UpdatePreviewAsync>b__0() in D:\src\pdn\src\PaintDotNet\Dialogs\SaveConfigDialog.cs:line 604
at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at PaintDotNet.Dialogs.SaveConfigDialog.<UpdatePreviewAsync>d__48.MoveNext() in D:\src\pdn\src\PaintDotNet\Dialogs\SaveConfigDialog.cs:line 623