Page 1 of 1

ImageMagick Sepia not working on iPhone ARM?

Posted: 2010-04-19T17:19:32-07:00
by Vortec4800
The Sepia filter seems to be broken when I run it on the device. On the simulator, it works properly - on the device I just get a turquoise image. The solarize filter doesn't work either (and does on the Sim). I checked to make sure the math was all correct, and the filters are definitely receiving the same values on device as on sim. Any ideas on what to look for on this?

Re: ImageMagick Sepia not working on iPhone ARM?

Posted: 2010-04-19T18:16:28-07:00
by magick
We do not have an ARM environment so we can't debug this problem. The code looks fairly straight-forward so we cannot determine the problem strictly from visual inspection.

Re: ImageMagick Sepia not working on iPhone ARM?

Posted: 2010-04-19T18:28:23-07:00
by Vortec4800
Hmm, is there anything else I might be able to do or try to help either you or I narrow down the issue?

Re: ImageMagick Sepia not working on iPhone ARM?

Posted: 2010-04-19T18:45:17-07:00
by magick
The Sepia tone effect includes a call to NormalizeImage() and ContrastImage(). You could check the -normalize and -contrast options to see if it fails in these methods rather than SepiaToneImage(). Otherwise you need to inject debug statements in the code (magick/fx.c/SepiaToneImage/3901) and compare the results on the iPhone and Mac OS X. Any deviations may give us insight into the problem.

We use C99 C code which should compile properly on any compiler and run on virtually any processor including an ARM. However, there may be some caveats associated with developing on an ARM processor. If you have a reference, post a URL here.

The last option would be to give us instructions to build and install ImageMagick on the iPhone such that we can access the output of any debugging statements we include. We'll try debugging ourselves on our iPhone. We have little experience on the iPhone so we'll need detailed instructions to get debugging working on the iPhone.

Re: ImageMagick Sepia not working on iPhone ARM?

Posted: 2010-04-19T18:50:45-07:00
by Vortec4800
Sounds good. I'll get to it and send you guys anything I find.

Re: ImageMagick Sepia not working on iPhone ARM?

Posted: 2010-04-21T16:00:12-07:00
by Vortec4800
Here are two archives. One contains a test project with the Image Magick frameworks already in it. This project compiles and runs both on the simulator and on the device (it only compiles on the iPad for some reason, not the iPhone - it's an issue with the j0 math functions). On the simulator, the sepia function works properly - on the device I get the turquoise image. The libraries included are IM-6.6.1-4. In order to successfully compile for the simulator, you need to open the project settings and check the Enable OpenMP box.

The other archive is the build script and source I'm using to compile Image Magick for iPhone and for the Sim. You can take a look at this and see how I have everything set up to compile. Let me know if you're able to get this working, or if you need any more details.

http://homepage.mac.com/cory.imdieke/im-build.zip
http://homepage.mac.com/cory.imdieke/IMTest.zip

Re: ImageMagick Sepia not working on iPhone ARM?

Posted: 2010-04-21T16:53:15-07:00
by magick
Thanks. It may take a week or so. We're swamped with some other work.

Re: ImageMagick Sepia not working on iPhone ARM?

Posted: 2010-04-30T16:48:56-07:00
by Vortec4800
I don't suppose you guys have been able to look over this yet? I've posted some additional info in this thread:

viewtopic.php?f=2&t=16043

on page two. Thanks!