stripped down ImageMagick for JPEG compression?
Posted: 2007-07-10T15:43:49-07:00
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:
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;
}