Esempio n. 1
0
File: imgmin.c Progetto: dpq/imgmin
static void optimize_image(MagickWand *mw, const char *src, const char *dst,
                           size_t size_in, unsigned char *blob_in,
                           const struct imgmin_options *opt)
{
    MagickWand *tmp;
    size_t size_out = size_in + 1;

    report_before(mw, size_in);

#ifdef IMGMIN_STANDALONE
/*
 * NOTE: for now only allow use of external PNG tools in a standalone cmdline app,
 * not the built-in apache -- it's slower and less trustworthy.
 */
    if (strcmp("-", src) && !strcmp("PNG", MagickGetImageFormat(mw)))
    {
        do_png(mw, src, dst, opt);
        return;
    } else {
#endif
        tmp = search_quality(mw, dst, opt);
#ifdef IMGMIN_STANDALONE
    }
#endif

    size_out = blob_write(blob_in, size_in, tmp, dst);
    report_after(tmp, size_in, size_out);
    DestroyMagickWand(tmp);
}
int main(int argv, char **argc) {
 
  if(argv != 5) {
    cout << "Usage: ./CalibrationSinglePlot.exec toyfile.root smsfile.root massGlu massLSP" << endl;
    return -1;
  }

  string toyfile(argc[1]);
  string smsfile(argc[2]);
  string massGlu(argc[3]);
  string massLSP(argc[4]);

  do_png(1);
  do_pdf(1);
  char currentpath[1024];
  char *path = getcwd(currentpath, 1024);
  PlottingSetup::basedirectory=string(currentpath)+"/";
  plots_for_config(toyfile, smsfile, massGlu, massLSP);

  return 0;

}