IronOCR OCR 프로그램과 함께 libgdiplus 사용: 이미지 텍스트 변환 설정 가이드
.NET Core는 Microsoft System.Drawing.Common NuGet 패키지를 사용하기 위해 libgdiplus를 필요로 합니다. macOS나 Linux에서 발견되지 않을 경우, 다음과 같은 예외가 발생할 수 있습니다:
- _처리되지 않은 예외입니다. System.DllNotFoundException: 네이티브 라이브러리를 찾거나 로드할 수 없습니다. [ libgdiplus, libgdiplus.so ]
System.TypeInitializationException: The type initializer for 'Gdip' threw an exception,을(를) 보신다면, 대신 우리의 .NET6에서 System.Drawing.Common 가이드를 읽어보세요.
리눅스
우분투, 데비안
Ubuntu 또는 Debian에서 필요한 라이브러리를 설치하려면 다음 명령을 실행하세요:
# Update package lists and install necessary libraries
sudo apt-get update && sudo apt-get install -y apt-utils libgdiplus libc6-dev
# Update package lists and install necessary libraries
sudo apt-get update && sudo apt-get install -y apt-utils libgdiplus libc6-dev
Docker
Docker 이미지에 필요한 라이브러리를 포함하기 위해 Dockerfile에 다음 줄을 추가하세요:
# Update package lists and install necessary libraries in Docker container
RUN apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev
macOS
macOS에서 다음 예외가 발생하면:
_처리되지 않은 예외. System.DllNotFoundException: 네이티브 라이브러리를 찾거나 로드할 수 없습니다. [ libgdiplus, libgdiplus.dylib ]
이를 해결하려면:
- runtime.osx.10.10-x64.CoreCompat.System.Drawing NuGet 패키지를 .NET 솔루션에 추가하여 프로젝트에 libgdiplus를 포함하십시오.
- 또는, Homebrew를 통해 아래 명령으로 라이브러리를 수동 설치하십시오:
# Update Homebrew and install mono-libgdiplus
brew update && brew install mono-libgdiplus
# Update Homebrew and install mono-libgdiplus
brew update && brew install mono-libgdiplus
- 자세한 정보는 공식 .NET 문서에서 확인할 수 있습니다.

