Forum Replies Created

Viewing 1 post (of 1 total)
  • Author
    Posts
  • in reply to: running sips via Perl/PHP system function #372645
    kilkonie
    Participant

    In reference to your sips utility not working via PHP. Are you using MAMP?
    First try running this script from PHP. You should add it to /usr/bin and change the permissions, etc.

    [code]#!/bin/sh

    /usr/bin/sips -s format png $1 –out $2.png 2> /tmp/error[/code]

    Pass in your input and output files accordingly. Look at the error log. It appears that I was suffering from a symbol collision with a MAMP-installed shared library. The PDFLib folks suffer from the same issue. Here’s their take on it:

    [code]
    PDFlib with XAMPP or MAMP on Mac OS X. If you add the PDFlib PHP extension to
    your php.ini on a Mac OS X Intel box with XAMPP Mac OS X 0.6.3 installed, the following
    error message appears:
    dyld: NSLinkModule() error
    dyld: Symbol not found: __cg_jpeg_resync_to_restart
    Referenced from: /System/Library/Frameworks/ApplicationServices.framework/Versions/A/
    Frameworks/ImageIO.framework/Versions/A/ImageIO
    Expected in: /Applications/xampp/xamppfiles/lib/libjpeg.62.dylib
    The PDFlib extension is linked against the ApplicationServices Framework, and XAMPP
    changes the DYLD_LIBRARY_PATH. This combination confuses the dynamic link editor.
    We detected that commenting out DYLD_LIBRARY_PATH in xamppfiles/bin/envvars cures
    this problem.
    A similar problem arises with MAMP. To cure the problem with MAMP comment out
    DYLD_LIBRARY_PATH in Library/bin/envvars.
    [/code]

    Of course, sips is also linked to the ApplicationServices Framework. So I pulled the DYLD_LIBRARY_PATH and restarted apache and it works. I’m not sure what the side effects are from doing this. (Like GD might have stopped working, for all I know.)

    And, yes, I do remember there were some changes to the jpeg library around 10.4. Apple shipped with an old version (and linked some things statically, other dynamically). I remember running across this issue a year or two ago when I was getting ImageMagick and GraphViz working from source.

    Hope this helps.

Viewing 1 post (of 1 total)