stripped down ImageMagick for JPEG compression?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
zacwitte

stripped down ImageMagick for JPEG compression?

Post by zacwitte »

I'm using ImageMagick to make a drag and drop JPEG recompressor for the mac and I watch to package ImageMagick with my app. I've written a very simple program using the Magick++ API, but since it uses dynamic libraries, I'm not sure exactly what files I need to include with my app besides libMagick++.so. There are thousands of file, taking up quite a lot of space and I can't imagine that they're all needed.

This is the code for my app:

Code: Select all

#include <iostream>
#include "Magick++.h"

using namespace std;
using namespace Magick;

int main(int argc, char** argv) {
    if (argc < 2) {
        cout << "Usage: JPGCrusher <imagename.jpg>" << endl;
        return 1;
    }
   
    Image image;
   
    image.read(argv[1]);
    image.compressType (JPEGCompression);
    image.quality(75);
    image.write(argv[1]);
   
   
    return 0;
}
Post Reply