glindstedt / xwobf

X Window Obfuscator
MIT License
56 stars 4 forks source link

Wouldn't compile #5

Open PMunch opened 7 years ago

PMunch commented 7 years ago

Had some trouble getting it to compile. It was complaining about too few and too many arguments to various Magick functions. I removed the trailing 0 from all MagickResizeImage calls and added a MagickTrue as the fourth argument to MagickCompositeImage to comply with this: https://www.imagemagick.org/api/magick-image.php

After that everything compiles fine. Is this an ImageMagick version issue?

svvac commented 6 years ago

Stumbled upon the same problem. Turned out it was using libmagick7 when this tool seem to have been written for version 6.

brihadeesh commented 6 years ago

I seem to be facing a similar issue here:

cc -Wall -std=c99 `pkg-config --cflags MagickWand xcb` -c xwobf.c
xwobf.c:29:10: fatal error: MagickWand/MagickWand.h: No such file or directory
 #include <MagickWand/MagickWand.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.`
Makefile:31: recipe for target 'xwobf.o' failed
make: *** [xwobf.o] Error 1
sbuller commented 5 years ago

So, I'm running fedora, and I encountered the same error as @ossix. I worked around it ...

diff --git a/xwobf.c b/xwobf.c
index 88dc631..ac643e2 100644
--- a/xwobf.c
+++ b/xwobf.c
@@ -191,14 +191,14 @@ void obscure_rectangle(rectangle_t *rec, int pixel_size, int fuzzy)

         // This is where the magick happens
         (void)MagickResizeImage(obs_wand, (rec->w)/pixel_size, (rec->h)/pixel_size,
-                PointFilter);
+                PointFilter, pixel_size);
         if (fuzzy) {
                 (void)MagickBlurImage(obs_wand, 0, 1);
         }
         (void)MagickResizeImage(obs_wand, rec->w, rec->h,
-                PointFilter);
+                PointFilter, pixel_size);

-        (void)MagickCompositeImage(wand, obs_wand, OverCompositeOp, MagickTrue, rec->x, rec->y);
+        (void)MagickCompositeImage(wand, obs_wand, OverCompositeOp,  rec->x, rec->y);

         obs_wand = DestroyMagickWand(obs_wand);
     }

It seems to run. :shrug: