Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am attempting to pull metadata from photos in a .Net Core App by using this library:
https://www.codeproject.com/Articles/27242/ExifTagCollection-An-EXIF-metadata-extraction-libr
However while implementing the ExifTagCollection class I am getting the Error listed in the title.
I have successfully referenced System.Drawing but it is not recognizing its drawing extension. Any help would be great. Also open to suggestions for other libraries to accomplish my goal. Thx
–
–
–
If you're looking for System.Drawing-related functionality on .NET Core, you should be able to use
System.Drawing.Common
.
It provides the System.Drawing API on .NET Core and works on Windows, Linux and macOS.
If you're on Linux and macOS, you'll need to install libgdiplus for this to work. To install libgdiplus on macOS, run
brew install mono-libgdiplus
; on Linux you should be able to install the
libgdiplus
package using your package manager. This deployment will hopefully get easier in the future.
It's currently in preview on NuGet as the
System.Drawing.Common
package.
Long term, you may want to consider migrating to other libraries such as ImageSharp.
If you take a look at the site of
microsoft
you will see:
"Classes within the System.Drawing.Imaging namespace are not supported for use within a Windows or ASP.NET service. Attempting to use these classes from within one of these application types may produce unexpected problems, such as diminished service performance and run-time exceptions."
You are creating a web application with ASP.net so this class isn't supported for your project
–
–
As @TimonPost says, you cannot use that namespace from ASP.NET, because it relies on there being an interactive session (which is why it also won't work from a Windows Service).
If you just want an easy way to access metadata from images that works in ASP.NET Core, check out my
MetadataExtractor
library.
https://github.com/drewnoakes/metadata-extractor-dotnet
–
–
Thanks for contributing an answer to Stack Overflow!
-
Please be sure to
answer the question
. Provide details and share your research!
But
avoid
…
-
Asking for help, clarification, or responding to other answers.
-
Making statements based on opinion; back them up with references or personal experience.
To learn more, see our
tips on writing great answers
.