]> git.sur5r.net Git - ptouch-print/blobdiff - src/ptouch-print.c
cosmetic updates ;-)
[ptouch-print] / src / ptouch-print.c
index 890db4e969b972058522c2399878e68ca3a1ddaf..e99e6ae609f383271359ec75fd0e195d832b330a 100644 (file)
@@ -1,7 +1,7 @@
 /*
        ptouch-print - Print labels with images or text on a Brother P-Touch
        
-       Copyright (C) 2015 Dominic Radermacher <dominic.radermacher@gmail.com>
+       Copyright (C) 2015-2017 Dominic Radermacher <blip@mockmoon-cybernetics.ch>
 
        This program is free software; you can redistribute it and/or modify it
        under the terms of the GNU General Public License version 3 as
@@ -59,11 +59,21 @@ void rasterline_setpixel(uint8_t rasterline[16], int pixel)
        return;
 }
 
+void unsupported_printer(ptouch_dev ptdev)
+{
+       printf(_("your printer unfortunately is not supported by this tool\n"));
+       printf(_("the rasterdata a transferred in some other (unknown) format\n"));
+       exit(1);
+}
+
 int print_img(ptouch_dev ptdev, gdImage *im)
 {
        int d,i,k,offset,tape_width;
        uint8_t rasterline[16];
 
+       if ((ptdev->devinfo->flags & FLAG_UNSUP_RASTER) == FLAG_UNSUP_RASTER) {
+               unsupported_printer(ptdev);
+       }
        tape_width=ptouch_getmaxwidth(ptdev);
        /* find out whether color 0 or color 1 is darker */
        d=(gdImageRed(im,1)+gdImageGreen(im,1)+gdImageBlue(im,1) < gdImageRed(im,0)+gdImageGreen(im,0)+gdImageBlue(im,0))?1:0;