|
Post by vovchik on Oct 15, 2018 11:11:39 GMT 1
Dear all, Here is a tiny command line program to crop and convert images. It uses gdk_pixbuf to do all the heavy lifting: imgcrop (simple image cropper/converter) v.0.1a by vovchik, Oct 2018 --- Input formats supported: pnm, pbm, pgm, ppm, tga, xpm, tiff, pcx, gif, xbm, wmf, icns, bmp, png, jpg, svg and ico. Output formats supported: png, jpg, bmp, tiff and ico. Input parameters: oldname newname x_start y_start width height --- Example: imgcrop test.jpg test1.png 5 5 240 240 or imgcrop test.png -size (shows dimensions) --- Check out BaCon at www.basic-converter.org. I hope it is useful and works for you. With kind regards, vovchik Attachments:imgcrop.bac.tar.gz (2.32 KB)
|
|
|
Post by bigbass on Oct 15, 2018 15:28:19 GMT 1
hello vovchik Thanks for the image crop tool! will come in handy for many uses P.S I like what you did a lot (and don't want to seem picky at all ) a mistake I made by testing quickly my fault I started off wrong by using the defaults 5 5 240 240 when my image was only pi@raspberrypi:~/Downloads $ ./imgcrop test.png -size 337x210 so to bullet proof your error codes from those types of things maybe a check size input >= output or else GdkPixbuf will throw errors Joe
|
|
|
Post by vovchik on Oct 15, 2018 16:01:26 GMT 1
Dear Joe, Thanks. I had exactly the same thought, and will post a version (in the first post) that checks for proper dimensions and allows for a default 0 0 0 0 shortly. I am now testing. With kind regards, vovchik
|
|