Skip to content

Mac OS metadata throws exception #87

@jh197033

Description

@jh197033

using all the examples on the website whether I hard code the individual .jpeg file or hard code the directory I still keep getting the same error:

mesaage: Image loading failed.
stack trace: at GroupDocs.Metadata.Formats.Image.ImageRootPackage.xlvkm45y4n3jd8yancakp2dhnzf6x6gju0017u0010u000fu0015u0002()
at GroupDocs.Metadata.Formats.Image.ImageRootPackage.pfq4rhh3tnxzrhuh6z5nyqfxm3nvff3ju0017u0010u000fu0015u0002()
at GroupDocs.Metadata.Common.RootMetadataPackage.u0002.u0002()
at u000eu0019u001a2.u0003.u0005() at u000eu0019u001a2.�u0002(u0002 u0002)
at u000eu0019u001a2.u000eu0019u001a2u0017u0010u000fu0015u0005u0002(u0002 u0002)
at GroupDocs.Metadata.Common.MetadataPackage.u0002(String u0002)
at GroupDocs.Metadata.Common.RootMetadataPackage.get_FileType()
at GroupDocs.Metadata.Metadata.get_FileFormat()

example code 1:
using (Stream stream = File.Open(file.FullName, FileMode.Open, FileAccess.ReadWrite))
using (Metadata metadata = new Metadata(stream))
{
if (metadata.FileFormat != FileFormat.Unknown)
{
IDocumentInfo info = metadata.GetDocumentInfo();
Console.WriteLine("File format: {0}", info.FileType.FileFormat);
Console.WriteLine("File extension: {0}", info.FileType.Extension);
Console.WriteLine("MIME Type: {0}", info.FileType.MimeType);
Console.WriteLine("Number of pages: {0}", info.PageCount);
Console.WriteLine("Document size: {0} bytes", info.Size);
Console.WriteLine("Is document encrypted: {0}", info.IsEncrypted);
}
}

example code 2:
using (Metadata metadata = new Metadata(file.FullName))
{
if (metadata.FileFormat != FileFormat.Unknown)
{
IDocumentInfo info = metadata.GetDocumentInfo();
Console.WriteLine("File format: {0}", info.FileType.FileFormat);
Console.WriteLine("File extension: {0}", info.FileType.Extension);
Console.WriteLine("MIME Type: {0}", info.FileType.MimeType);
Console.WriteLine("Number of pages: {0}", info.PageCount);
Console.WriteLine("Document size: {0} bytes", info.Size);
Console.WriteLine("Is document encrypted: {0}", info.IsEncrypted);
}
}

file.FullName = "/Users/username/ImageAndVideoSorter/abc123.jpeg"

What am I doing wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions