Skip to content

Script and instructions to compile imagemagick as a static library to use in any iPhone project

Notifications You must be signed in to change notification settings

mgod/imagemagick_lib_iphone

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Compiled downloads

You can grab the latest compiled ImageMagick directly from their ftp or any mirror.

There is always 2 packages for the compiled ImageMagick:

  • iOSMagick-VERSION-libs.zip
  • iOSMagick-VERSION.zip

The first one includes headers and compiled libraries that have been used to compile ImageMagick. Most users would need this one.

ImageMagick compiling script for iPhone OS and iPhone Simulator

The directory structure has to be:

./cross_compile/ImageMagick-VERSION/     <- ImageMagick top directory

./cross_compile/IMDelegataes/	                <- Some delegates: jpeg + png + tiff
./cross_compile/IMDelegataes/jpeg-8c/         <- jpeg-8c -- no need to patch it
./cross_compile/IMDelegataes/libpng-1.5.13    <- png lib -- no need to patch it
./cross_compile/IMDelegataes/tiff-4.0.3       <- tiff lib -- no need to patch it

./cross_compile/magick-config.h

If you don’t have this directory structure you can either create it or try change around the script. For some reason, magick-config.h does not show up correctly for me when I build the project, so the script looks for a valid copy of this file to use when building the project. You’ll need to grab a valid copy of this file for the version of ImageMagick that you are compiling. You can find the delegate libraries on the ImageMagick ftp

To run the script:

./imagemagick_compile.sh VERSION

where VERSION is the version of ImageMagick you want to compile (i.e.: 6.8.0-8, svn, …)

This script will compile ImageMagick as a static library to be included in iPhone projects
Support for:

  • png
  • jpeg
  • tiff

Upon successful compilation a folder called “IMPORT_ME” will be created from where you start the script: you can import it into your XCode project

XCode project settings

After including everything into XCode please also make sure to have these settings (Build tab of the project information):

  • Other Linker Flags: -lMagickCore -lMagickWand -lz -lbz2 -ljpeg -lpng
  • Header Search Paths: $(SRCROOT) – make it Recursive
  • Library Search Paths: $(SRCROOT) – make it Recursive

On the lower left click on the small-wheel and select: Add User-Defined Setting

  • Key: OTHER_CFLAGS
  • Value: -Dmacintosh=1

In Link Binary with Libraries under Build Phases, you may also need to add:

  • libxml2.dylib

Sample project

A more or less updated project is found in the IM_Test subfolder

About

Script and instructions to compile imagemagick as a static library to use in any iPhone project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 94.6%
  • Shell 2.6%
  • Objective-C 2.0%
  • C++ 0.8%