pdurdin

Error opening JPGs with latest version

Recommended Posts

With the latest update of Paint.NET 4.2 (July 13 build) I can no longer open JPGs as developed from my NEF raw images with RawTherapee 5.1 -- with earlier versions of Paint.NET I never encountered this issue.

 

Here's the error it gives:

 

Application version: paint.net 4.2

System.InvalidCastException: Variant type 4108 not supported
   at PaintDotNet.SystemLayer.Native.x64.NativeConversions.FromPROPVARIANT(tagPROPVARIANT* propVariant)
   at PaintDotNet.SystemLayer.Native.x64.Imaging.WICMetadataQueryReader.TryGetMetadataByName(String name, Object& value)
   at PaintDotNet.Imaging.MetadataQueryReaderExtensions.TryGetMetadataByName(IMetadataQueryReader metadata, String name) in D:\src\pdn\src\Core\Imaging\MetadataQueryReaderExtensions.cs:line 80
   at PaintDotNet.Imaging.MetadataQueryReaderExtensions.<GetEntries>d__5.MoveNext() in D:\src\pdn\src\Core\Imaging\MetadataQueryReaderExtensions.cs:line 143
   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()
   at PaintDotNet.Data.ExifMetadataReader.<EnumerateExifPropertyItems>d__4.MoveNext() in D:\src\pdn\src\PaintDotNet\Data\ExifMetadataReader.cs:line 98
   at PaintDotNet.Data.ExifMetadataReader.<EnumerateExifPropertyItems>d__2.MoveNext() in D:\src\pdn\src\PaintDotNet\Data\ExifMetadataReader.cs:line 71
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at PaintDotNet.Collections.EnumerableExtensions.ToArrayEx[T](IEnumerable`1 items) in D:\src\pdn\src\Base\Collections\EnumerableExtensions.cs:line 40
   at PaintDotNet.Data.ExifMetadataReader.EnumerateExifPropertyItems() in D:\src\pdn\src\PaintDotNet\Data\ExifMetadataReader.cs:line 41
   at PaintDotNet.Data.WicFileTypeHelpers.Load(Stream input, Nullable`1 forcedContainerFormat, Nullable`1 preferredVendor, MetadataTranscoder metadataTranscoder) in D:\src\pdn\src\PaintDotNet\Data\WicFileTypeHelpers.cs:line 74
   at PaintDotNet.Data.JpegFileType.OnLoad(Stream input) in D:\src\pdn\src\PaintDotNet\Data\JpegFileType.cs:line 104
   at PaintDotNet.FileType.Load(Stream input) in D:\src\pdn\src\Data\FileType.cs:line 482
   at PaintDotNet.Functional.Func.Eval[T1,TRet](Func`2 f, T1 arg1) in D:\src\pdn\src\Base\Functional\Func.cs:line 158

Share this post


Link to post
Share on other sites

Looks like Paint.NET is having trouble reading the image's metadata.  Do you have an example image you're willing to share for debugging?

Share this post


Link to post
Share on other sites

I downloaded your file and renamed it to .PNG and Paint.NET opened the file just fine.

 

However, the What Is It Plugin identifies it as a .JPEG file format.

 

This actually concerns me.  I think @Rick Brewster will have to investigate this.

Share this post


Link to post
Share on other sites
6 hours ago, BoltBait said:

I downloaded your file and renamed it to .PNG and Paint.NET opened the file just fine.

 

However, the What Is It Plugin identifies it as a .JPEG file format.

 

That would make sense if the image contains some unsupported metadata.

In that case Paint.NET would load the image data and skip the metadata (because it is not PNG format metadata).

Share this post


Link to post
Share on other sites
8 hours ago, BoltBait said:

I downloaded your file and renamed it to .PNG and Paint.NET opened the file just fine.

 

However, the What Is It Plugin identifies it as a .JPEG file format.

 

This actually concerns me.  I think @Rick Brewster will have to investigate this.

 

If you rename it to another format then Paint.NET will be able to load the image but not the metadata.

Share this post


Link to post
Share on other sites

It sounds like your "RawTherapee" program is emitting a weird bit of metadata that WIC is interpreting as a "vector of variants" (4108 = 0x100C = VT_VECTOR | VT_VARIANT).

 

Anyway thanks for reporting this. I should be able to fix this easily for the 4.2.1 update by skipping over the metadata. Whatever that metadata entry is, it will likely not be preservable, but we'll see

 

Share this post


Link to post
Share on other sites

I'm able to reproduce the error with that image you put on DropBox 👍

 

I'm hoping to put out 4.2.1 "soon", by the end of next week maybe.

Share this post


Link to post
Share on other sites

Thanks for the many quick responses!

 

I've updated RawTherapee to the latest version, and still encounter the same issue with JPGs developed from my raw images. However, if I develop them as TIF instead, they retain the same EXIF data but Paint.NET has no trouble opening them (https://www.dropbox.com/s/uqgaw82z47hh01b/DSC_2165.tif if needed for testing).

 

Is there somewhere I can download the previous release of Paint.NET to use until this issue is fixed?

Edited by pdurdin

Share this post


Link to post
Share on other sites
49 minutes ago, toe_head2001 said:

 

Older versions can be found here: https://filehippo.com/download_paint.net/history/

 

Thanks! 4.1.5 installed now and opens the images fine, so I can get on with using that temporarily.

 

20 minutes ago, Rick Brewster said:

Just make sure to NOT disable the updater, and to then install 4.2.1 when it's offered.

 

Will do. Feel free to use those images for any test/debug purposes needed!

Share this post


Link to post
Share on other sites

So it is/was a specific PDN version issue.

 

Not sure why my post suggesting that might be the case has gone missing but I'm glad it is being sorted, that's the important thing.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.