Hello community, here is the log from the commit of package imgp for openSUSE:Factory checked in at 2018-02-20 17:56:32 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/imgp (Old) and /work/SRC/openSUSE:Factory/.imgp.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "imgp" Tue Feb 20 17:56:32 2018 rev:3 rq:578273 version:2.5 Changes: -------- --- /work/SRC/openSUSE:Factory/imgp/imgp.changes 2017-10-13 14:19:31.591156447 +0200 +++ /work/SRC/openSUSE:Factory/.imgp.new/imgp.changes 2018-02-20 17:58:05.951931536 +0100 @@ -1,0 +2,8 @@ +Tue Feb 20 07:50:48 UTC 2018 - aloi...@gmx.com + +- Update to version 2.5 + * New option --nn to use nearest neighbour interpolation for PNG + files + * Identify Multi Picture Object (MPO) files + +------------------------------------------------------------------- Old: ---- imgp-2.4.1.tar.gz New: ---- imgp-2.5.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ imgp.spec ++++++ --- /var/tmp/diff_new_pack.jNsrQU/_old 2018-02-20 17:58:06.847899276 +0100 +++ /var/tmp/diff_new_pack.jNsrQU/_new 2018-02-20 17:58:06.847899276 +0100 @@ -1,7 +1,7 @@ # # spec file for package imgp # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: imgp -Version: 2.4.1 +Version: 2.5 Release: 0 Summary: Image resizer and rotator License: GPL-3.0+ @@ -86,21 +86,18 @@ install -m0644 auto-completion/zsh/_%{name} -t %{buildroot}%{_datadir}/zsh/site-functions %files -%defattr(-,root,root) -%doc CHANGELOG LICENSE README.md +%doc CHANGELOG README.md +%license LICENSE %{_bindir}/%{name} %{_mandir}/man1/%{name}.1%{ext_man} %files bash-completion -%defattr(-,root,root) %{_datadir}/bash-completion/completions/%{name}-completion.bash %files fish-completion -%defattr(-,root,root) %{_datadir}/fish/completions/%{name}.fish %files zsh-completion -%defattr(-,root,root) %{_datadir}/zsh/site-functions/_%{name} %changelog ++++++ imgp-2.4.1.tar.gz -> imgp-2.5.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imgp-2.4.1/CHANGELOG new/imgp-2.5/CHANGELOG --- old/imgp-2.4.1/CHANGELOG 2017-08-29 17:50:07.000000000 +0200 +++ new/imgp-2.5/CHANGELOG 2018-02-19 04:29:45.000000000 +0100 @@ -1,3 +1,12 @@ +imgp v2.5 +2018-02-19 + +What's in? +- New option `--nn` to use nearest neighbour interpolation for PNG files +- Identify Multi Picture Object (MPO) files + +------------------------------------------------------------------------------- + imgp v2.4.1 2017-08-29 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imgp-2.4.1/README.md new/imgp-2.5/README.md --- old/imgp-2.4.1/README.md 2017-08-29 17:50:07.000000000 +0200 +++ new/imgp-2.5/README.md 2018-02-19 04:29:45.000000000 +0100 @@ -3,8 +3,10 @@ <p align="center"> <a href="https://github.com/jarun/imgp/releases/latest"><img src="https://img.shields.io/github/release/jarun/imgp.svg?maxAge=600" alt="Latest release" /></a> <a href="https://aur.archlinux.org/packages/imgp"><img src="https://img.shields.io/aur/version/imgp.svg?maxAge=600" alt="AUR" /></a> -<a href="https://packages.debian.org/search?keywords=imgp&searchon=names&exact=1"><img src="https://img.shields.io/badge/debian-9+-blue.svg?maxAge=2592000" alt="Debian Strech+" /></a> -<a href="http://packages.ubuntu.com/search?keywords=imgp&searchon=names&exact=1"><img src="https://img.shields.io/badge/ubuntu-17.04+-blue.svg?maxAge=2592000" alt="Ubuntu Zesty+" /></a> +<a href="https://github.com/jarun/homebrew-imgp"><img src="https://img.shields.io/badge/homebrew-TAP-blue.svg?maxAge=2592000" alt="Homebrew TAP" /></a> +<a href="https://packages.debian.org/search?keywords=imgp&searchon=names&exact=1"><img src="https://img.shields.io/badge/debian-9+-blue.svg?maxAge=2592000" alt="Debian Stretch+" /></a> +<a href="https://packages.ubuntu.com/search?keywords=imgp&searchon=names&exact=1"><img src="https://img.shields.io/badge/ubuntu-17.04+-blue.svg?maxAge=2592000" alt="Ubuntu Zesty+" /></a> +<a href="https://launchpad.net/~twodopeshaggy/+archive/ubuntu/jarun/"><img src="https://img.shields.io/badge/ubuntu-PPA-blue.svg?maxAge=2592000" alt="Ubuntu PPA" /></a> <a href="https://github.com/jarun/imgp/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-GPLv3-yellow.svg?maxAge=2592000" alt="License" /></a> </p> @@ -12,15 +14,19 @@ <a href="https://asciinema.org/a/e5qa0mipgg23v70hdn6i99b8q"><img src="https://asciinema.org/a/e5qa0mipgg23v70hdn6i99b8q.png" alt="imgp_asciicast" width="734"/></a> </p> -`imgp` is a command line image resizer and rotator for JPEG and PNG images. If you have tons of images you want to resize adaptively to a screen resolution or rotate by an angle using a single command, `imgp` is the utility for you. It can save a lot on storage too. +<p align="center"><i>Watch imgp resize a directory of images in lightning speed!</i></p> + +`imgp` is a command line image resizer and rotator for JPEG and PNG images. It can resize (or thumbnail) and rotate thousands of images in a go, at lightning speed, while saving significantly on storage. Powered by multiprocessing, an intelligent adaptive algorithm, recursive operations, shell completion scripts, EXIF preservation (and more), `imgp` is a very flexible utility with well-documented easy to use options. `imgp` intends to be a stronger replacement of the Nautilus Image Converter extension, not tied to any file manager and way faster. On desktop environments (like Xfce or LxQt) which do not integrate Nautilus, `imgp` will save your day. +*Love smart and efficient terminal utilities? Explore my repositories. Buy me a cup of coffee if they help you.* + <p align="center"> <a href="https://saythanks.io/to/jarun"><img src="https://img.shields.io/badge/say-thanks!-ff69b4.svg" /></a> -<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q"><img src="https://img.shields.io/badge/PayPal-donate-FC746D.svg" alt="Donate via PayPal!" /></a> +<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=RMLTQ76JSXJ4Q"><img src="https://img.shields.io/badge/Donate-$5-green.svg" alt="Donate via PayPal!" /></a> </p> ### Table of Contents @@ -95,6 +101,9 @@ - [AUR](https://aur.archlinux.org/packages/imgp/) - [Debian](https://packages.debian.org/search?keywords=imgp&searchon=names&exact=1) - [Homebrew *tap*](https://github.com/jarun/homebrew-imgp) [`brew install jarun/imgp/imgp`] +- [openSUSE](https://software.opensuse.org/package/imgp) +- [Slackware](http://slackbuilds.org/repository/14.2/graphics/imgp/) +- [Source Mage](http://codex.sourcemage.org/test/graphics/imgp/) (`cast imgp`) - [Ubuntu](http://packages.ubuntu.com/search?keywords=imgp&searchon=names&exact=1) - [Ubuntu PPA](https://launchpad.net/~twodopeshaggy/+archive/ubuntu/jarun/) @@ -130,42 +139,46 @@ #### cmdline options - usage: imgp [-h] [-x res] [-o deg] [-a] [-c] [-d] [-e] [-f] [-i] [-k] [-m] - [-n] [-p] [-q N] [-r] [-s byte] [-w] [-z] - [PATH [PATH ...]] - - Resize, rotate JPEG and PNG images. - - positional arguments: - PATH source file or dir [default: current dir] - - optional arguments: - -h, --help show this help message and exit - -x res, --res res output resolution in HxV or percentage - -o deg, --rotate deg rotate clockwise by angle (in degrees) - -a, --adapt adapt to resolution by orientation [default: off] - -c, --convert convert PNG to JPG format [default: off] - -d, --dot include hidden files (on Linux) [default: off] - -e, --eraseexif erase exif metadata [default: off] - -f, --force force to exact specified resolution [default: off] - -i, --includeimgp re-process _IMGP files. * RISKY: refer to docs - -k, --keep skip (but convert, if opted) images with matching - specified hres or vres or --res=100 [default: off] - -m, --mute operate silently [default: informative] - -n, --enlarge enlarge smaller images [default: off] - -p, --optimize optimize the output images [default: off] - -q N, --quality N quality factor (N=1-95, JPEG only) [default: 75] - -r, --recurse process directories recursively [default: off] - symbolic links are ignored - -s byte, --size byte minimum size to process an image [default: 1024] - -w, --overwrite overwrite source images [default: off] - -z, --debug enable debug logs [default: off] +``` +usage: imgp [-h] [-x res] [-o deg] [-a] [-c] [-d] [-e] [-f] [-i] [-k] [-m] + [-n] [--nn] [-p] [-q N] [-r] [-s byte] [-w] [-z] + [PATH [PATH ...]] + +Resize, rotate JPEG and PNG images. + +positional arguments: + PATH source file or dir [default: current dir] + +optional arguments: + -h, --help show this help message and exit + -x res, --res res output resolution in HxV or percentage + -o deg, --rotate deg rotate clockwise by angle (in degrees) + -a, --adapt adapt to resolution by orientation [default: off] + -c, --convert convert PNG to JPG format [default: off] + -d, --dot include hidden files (on Linux) [default: off] + -e, --eraseexif erase exif metadata [default: off] + -f, --force force to exact specified resolution [default: off] + -i, --includeimgp re-process _IMGP files. * RISKY: refer to docs + -k, --keep skip (but convert, if opted) images with matching + specified hres or vres or --res=100 [default: off] + -m, --mute operate silently [default: informative] + -n, --enlarge enlarge smaller images [default: off] + --nn use nearest neighbour interpolation for PNG images + [default: antialias] + -p, --optimize optimize the output images [default: off] + -q N, --quality N quality factor (N=1-95, JPEG only) [default: 75] + -r, --recurse process directories recursively [default: off] + symbolic links are ignored + -s byte, --size byte minimum size to process an image [default: 1024] + -w, --overwrite overwrite source images [default: off] + -z, --debug enable debug logs [default: off] +``` #### Operational notes - Multiple files and directories can be specified as source. If `PATH` is omitted, the current directory is processed. - Output image names are appended with **_IMGP** if `--overwrite` option is not used. By default *_IMGP* files are not processed. Doing so may lead to potential race conditions when `--overwrite` option is used. -- PNG files with lower target hres/vres are not converted (even if `--convert` is used). Run `imgp --convert` to convert those. +- PNG files with lower target hres/vres are not converted (even if `--convert` is used). Run `imgp --convert (*.png)` separately to convert those. - Resize and rotate are lossy operations. For additional reductions in size try `--optimize` and `--eraseexif` options. - Option `--optimize` is slower, the encoder makes an extra pass over the image in order to select optimal encoder settings. @@ -173,57 +186,57 @@ 1. Convert some images and directories: - $ imgp -x 1366x768 ~/ ~/Pictures/image3.png ~/Downloads/ - /home/testuser/image1.png - 3840x2160 -> 1365x768 - 11104999 bytes -> 1486426 bytes - - /home/testuser/image2.jpg - 2048x1365 -> 1152x768 - 224642 bytes -> 31421 bytes - - /home/testuser/Pictures/image3.png - 1920x1080 -> 1365x768 - 2811155 bytes -> 1657474 bytes - - /home/testuser/Downloads/image4 - 2048x1365 -> 1152x768 - 224642 bytes -> 31421 bytes + $ imgp -x 1366x768 ~/ ~/Pictures/image3.png ~/Downloads/ + /home/testuser/image1.png + 3840x2160 -> 1365x768 + 11104999 bytes -> 1486426 bytes + + /home/testuser/image2.jpg + 2048x1365 -> 1152x768 + 224642 bytes -> 31421 bytes + + /home/testuser/Pictures/image3.png + 1920x1080 -> 1365x768 + 2811155 bytes -> 1657474 bytes + + /home/testuser/Downloads/image4 + 2048x1365 -> 1152x768 + 224642 bytes -> 31421 bytes 2. Scale an image by 75% and overwrite the source image: - $ imgp -x 75 -w ~/image.jpg - /home/testuser/image.jpg - 1366x767 -> 1025x575 - 120968 bytes -> 45040 bytes + $ imgp -x 75 -w ~/image.jpg + /home/testuser/image.jpg + 1366x767 -> 1025x575 + 120968 bytes -> 45040 bytes 3. Rotate an image clockwise by 90 degrees: - $ imgp -o 90 ~/image.jpg - 120968 bytes -> 72038 bytes + $ imgp -o 90 ~/image.jpg + 120968 bytes -> 72038 bytes 4. Adapt the images in the current directory to 1366x1000 resolution. Visit all directories recursively, overwrite source images, ignore images with matching hres or vres but convert PNG images to JPEG. - $ imgp -x 1366x1000 -wrack + $ imgp -x 1366x1000 -wrack 5. Set hres=800 and adapt vres maintaining the ratio. - $ imgp -x 800x0 - Source omitted. Processing current directory... + $ imgp -x 800x0 + Source omitted. Processing current directory... - ./image1.jpg - 1366x911 -> 800x534 - 69022 bytes -> 35123 bytes - - ./image2.jpg - 1050x1400 -> 800x1067 - 458092 bytes -> 78089 bytes + ./image1.jpg + 1366x911 -> 800x534 + 69022 bytes -> 35123 bytes + + ./image2.jpg + 1050x1400 -> 800x1067 + 458092 bytes -> 78089 bytes 6. Process images greater than 50KB (50*1024 bytes) only: - $ imgp -wrackx 1366x1000 -s 51200 + $ imgp -wrackx 1366x1000 -s 51200 ### Developers -1. Copyright © 2016-2017 [Arun Prakash Jana](https://github.com/jarun) +1. Copyright © 2016-2018 [Arun Prakash Jana](https://github.com/jarun) 2. [Ananya Jana](https://github.com/ananyajana) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imgp-2.4.1/auto-completion/bash/imgp-completion.bash new/imgp-2.5/auto-completion/bash/imgp-completion.bash --- old/imgp-2.4.1/auto-completion/bash/imgp-completion.bash 2017-08-29 17:50:07.000000000 +0200 +++ new/imgp-2.5/auto-completion/bash/imgp-completion.bash 2018-02-19 04:29:45.000000000 +0100 @@ -21,6 +21,7 @@ -k --keep -m --mute -n --enlarge + --nn -o --rotate -p --optimize -q --quality diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imgp-2.4.1/auto-completion/fish/imgp.fish new/imgp-2.5/auto-completion/fish/imgp.fish --- old/imgp-2.4.1/auto-completion/fish/imgp.fish 2017-08-29 17:50:07.000000000 +0200 +++ new/imgp-2.5/auto-completion/fish/imgp.fish 2018-02-19 04:29:45.000000000 +0100 @@ -14,6 +14,7 @@ complete -c imgp -s k -l keep --description 'skip images with matching hres or vres' complete -c imgp -s m -l mute --description 'operate silently' complete -c imgp -s n -l enlarge --description 'enlarge smaller images' +complete -c imgp -l nn --description 'use nearest neighbour interpolation for PNG' complete -c imgp -s o -l rotate -r --description 'rotate clockwise by angle (in degrees)' complete -c imgp -s p -l optimize --description 'optimize the output images' complete -c imgp -s q -l quality -r --description 'specify quality factor (1-95)' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imgp-2.4.1/auto-completion/zsh/_imgp new/imgp-2.5/auto-completion/zsh/_imgp --- old/imgp-2.4.1/auto-completion/zsh/_imgp 2017-08-29 17:50:07.000000000 +0200 +++ new/imgp-2.5/auto-completion/zsh/_imgp 2018-02-19 04:29:45.000000000 +0100 @@ -19,6 +19,7 @@ '(-k --keep)'{-k,--keep}'[skip images with matching hres or vres]' '(-m --mute)'{-m,--mute}'[operate silently]' '(-n --enlarge)'{-n,--enlarge}'[enlarge smaller images]' + '(--nn)--n[use nearest neighbour interpolation for PNG]' '(-o --rotate)'{-o,--rotate}'[rotate clockwise by angle]:degree' '(-p --optimize)'{-p,--optimize}'[optimize the output images]' '(-q --quiet)'{-q,--quality}'[specify quality factor (1-95)]:factor' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imgp-2.4.1/imgp new/imgp-2.5/imgp --- old/imgp-2.4.1/imgp 2017-08-29 17:50:07.000000000 +0200 +++ new/imgp-2.5/imgp 2018-02-19 04:29:45.000000000 +0100 @@ -2,7 +2,7 @@ # # Resize or rotate JPEG and PNG images. # -# Copyright © 2016-2017 Arun Prakash Jana <engineera...@gmail.com> +# Copyright © 2016-2018 Arun Prakash Jana <engineera...@gmail.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -47,9 +47,10 @@ debug = False # enable debug information no_res_opt = False # --res is not specified pad = '_IMGP' # output file suffix when --overwrite is unused +png_ip = PIL.Image.ANTIALIAS # default interpolation for PNG fill_color = '#ffffff' # BG color to strip alpha channel init_time = time.time() # profile the total time taken -_VERSION_ = '2.4.1' # current program version +_VERSION_ = '2.5' # current program version # Globals for multiprocessing pool = None @@ -132,9 +133,9 @@ try: img = Image.open(src) _format = img.format - if not (_format == 'JPEG' or _format == 'PNG'): + if not (_format == 'JPEG' or _format == 'PNG' or _format == 'MPO'): if debug: - lock_print(src + ': not JPEG or PNG image') + lock_print(src + ': not JPEG or PNG image. format: ' + _format) return try: if eraseexif: @@ -201,9 +202,9 @@ img = Image.open(src) _format = img.format - if not (_format == 'JPEG' or _format == 'PNG'): + if not (_format == 'JPEG' or _format == 'PNG' or _format == 'MPO'): if debug: - lock_print(src + ': not JPEG or PNG image') + lock_print(src + ': not JPEG or PNG image. format: ' + _format) return # if 'only' convert option is specified, @@ -230,6 +231,7 @@ vres = img.size[1] ImageFile.MAXBLOCK = hres * vres + antialias = png_ip if _format == 'PNG' else PIL.Image.ANTIALIAS if keep and (HRES == hres or VRES == vres or scale == 100): if not (_format == 'PNG' and convert): return @@ -249,7 +251,7 @@ _vres = _vres + 1 _vres = int(_vres) - img = img.resize((_hres, _vres), PIL.Image.ANTIALIAS) + img = img.resize((_hres, _vres), antialias) if debug: lock_print('resize_image: scaled to [%dx%d]' % (HRES, VRES)) elif HRES == 0 or VRES == 0: @@ -265,7 +267,7 @@ target_vres = target_vres + 1 target_vres = int(target_vres) - img = img.resize((HRES, target_vres), PIL.Image.ANTIALIAS) + img = img.resize((HRES, target_vres), antialias) if debug: lock_print('resize_image: 0 vres %dx%d' % (HRES, target_vres)) @@ -281,14 +283,14 @@ target_hres = target_hres + 1 target_hres = int(target_hres) - img = img.resize((target_hres, VRES), PIL.Image.ANTIALIAS) + img = img.resize((target_hres, VRES), antialias) if debug: lock_print('resize_image: 0 hres %dx%d' % (target_hres, VRES)) elif HRES == hres and VRES == vres: if debug: lock_print('resize_image: same res [%dx%d]' % (HRES, VRES)) elif force: - img = img.resize((HRES, VRES), PIL.Image.ANTIALIAS) + img = img.resize((HRES, VRES), antialias) if debug: lock_print('resize_image: brute force res to [%dx%d]' % (HRES, VRES)) elif adapt: @@ -310,7 +312,7 @@ target_vres = target_vres + 1 target_vres = int(target_vres) - img = img.resize((HRES, target_vres), PIL.Image.ANTIALIAS) + img = img.resize((HRES, target_vres), antialias) if debug: lock_print('resize_image: vres adapted %dx%d' % (HRES, target_vres)) elif (ratio_target < 1 and ratio_img < 1) or (ratio_target >= 1 and ratio_img <= 1): @@ -328,7 +330,7 @@ target_hres = target_hres + 1 target_hres = int(target_hres) - img = img.resize((target_hres, VRES), PIL.Image.ANTIALIAS) + img = img.resize((target_hres, VRES), antialias) if debug: lock_print('resize_image: hres adapted %dx%d' % (target_hres, VRES)) else: @@ -348,7 +350,7 @@ target_vres = target_vres + 1 target_vres = int(target_vres) - img = img.resize((HRES, target_vres), PIL.Image.ANTIALIAS) + img = img.resize((HRES, target_vres), antialias) if debug: lock_print('resize_image: vres calculated %dx%d' % (HRES, target_vres)) else: @@ -364,7 +366,7 @@ target_hres = target_hres + 1 target_hres = int(target_hres) - img = img.resize((target_hres, VRES), PIL.Image.ANTIALIAS) + img = img.resize((target_hres, VRES), antialias) if debug: lock_print('resize_image: hres calculated %dx%d' % (target_hres, VRES)) @@ -413,7 +415,7 @@ file.write(''' Version %s -Copyright © 2016-2017 Arun Prakash Jana <engineera...@gmail.com> +Copyright © 2016-2018 Arun Prakash Jana <engineera...@gmail.com> License: GPLv3 Webpage: https://github.com/jarun/imgp ''' % _VERSION_) @@ -464,6 +466,8 @@ help='operate silently [default: informative]') addarg('-n', '--enlarge', action='store_true', help='enlarge smaller images [default: off]') + addarg('--nn', action='store_true', + help='use nearest neighbour interpolation for PNG images [default: antialias]') addarg('-p', '--optimize', action='store_true', help='optimize the output images [default: off]') addarg('-q', '--quality', type=int, metavar='N', choices=range(1, 96), @@ -490,7 +494,7 @@ def main(): global HRES, VRES, scale, rotate, adapt, convert, dot, eraseexif, force, includeimgp, keep, enlarge, \ - optimal, mute, recurse, size, qual, overwrite, debug, no_res_opt, pool, init_time, count + optimal, mute, recurse, size, qual, overwrite, debug, no_res_opt, pool, init_time, count, png_ip args = parse_args() @@ -550,6 +554,8 @@ qual = args.quality overwrite = args.overwrite debug = args.debug + if args.nn: + png_ip = PIL.Image.NEAREST pool = Pool() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imgp-2.4.1/imgp.1 new/imgp-2.5/imgp.1 --- old/imgp-2.4.1/imgp.1 2017-08-29 17:50:07.000000000 +0200 +++ new/imgp-2.5/imgp.1 2018-02-19 04:29:45.000000000 +0100 @@ -1,4 +1,4 @@ -.TH "IMGP" "1" "Aug 2017" "Version 2.4.1" "User Commands" +.TH "IMGP" "1" "19 Feb 2018" "Version 2.5" "User Commands" .SH NAME imgp \- Resize, rotate JPEG and PNG images. .SH SYNOPSIS @@ -40,7 +40,7 @@ .br - Output image names are appended with \fB_IMGP\fR if '--overwrite' option is not used. By default \fB_IMGP\fR files are not processed. Doing so may lead to potential race conditions when '--overwrite' option is used. .br -- PNG files with lower target hres/vres are not converted (even if '--convert' is used). Run 'imgp --convert' to convert those. +- PNG files with lower target hres/vres are not converted (even if '--convert' is used). Run 'imgp --convert (*.png)' separately to convert those. .br - Resize and rotate are lossy operations. For additional reductions in size try '--optimize' and '--eraseexif' options. .br @@ -80,6 +80,9 @@ .BI "-n, --enlarge" Enlarge smaller images. By default smaller images are not scaled if specified resolution is greater. .TP +.BI "--nn" +Use nearest neighbour interpolation for PNG images instead of default antialias. +.TP .BI "-p, --optimize" Optimize output images using PIL library optimization algorithm. Disabled by default. .TP @@ -188,7 +191,7 @@ .SH REPORTING BUGS .I https://github.com/jarun/imgp/issues .SH LICENSE -Copyright \(co 2016-2017 Arun Prakash Jana <engineera...@gmail.com> +Copyright \(co 2016-2018 Arun Prakash Jana <engineera...@gmail.com> .PP License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>. .br diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imgp-2.4.1/packagecore.yaml new/imgp-2.5/packagecore.yaml --- old/imgp-2.4.1/packagecore.yaml 2017-08-29 17:50:07.000000000 +0200 +++ new/imgp-2.5/packagecore.yaml 2018-02-19 04:29:45.000000000 +0100 @@ -1,9 +1,8 @@ name: imgp -metadata: - maintainer: Arun Prakash Jana <engineera...@gmail.com> - license: GPLv3 - summary: Resize, rotate JPEG and PNG images.. - homepage: https://github.com/jarun/imgp +maintainer: Arun Prakash Jana <engineera...@gmail.com> +license: GPLv3 +summary: Multi-core batch image resizer and rotator. +homepage: https://github.com/jarun/imgp commands: install: - make PREFIX="/usr" install DESTDIR="${BP_DESTDIR}" @@ -14,12 +13,6 @@ deps: - python-pillow - python - fedora26: - builddeps: - - make - deps: - - python3-pillow - - python3 centos7.3: builddeps: - make @@ -29,19 +22,37 @@ commands: pre: - yum install epel-release - ubuntu16.04: + debian9: builddeps: - make deps: - python3-pillow - python3 - ubuntu17.10: + fedora26: builddeps: - make deps: - python3-pillow - python3 - debian9: + fedora27: + builddeps: + - make + deps: + - python3-pillow + - python3 + opensuse42.3: + builddeps: + - make + deps: + - python3-Pillow + - python3 + ubuntu16.04: + builddeps: + - make + deps: + - python3-pillow + - python3 + ubuntu17.10: builddeps: - make deps: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/imgp-2.4.1/tools/makedeb new/imgp-2.5/tools/makedeb --- old/imgp-2.4.1/tools/makedeb 2017-08-29 17:50:07.000000000 +0200 +++ new/imgp-2.5/tools/makedeb 1970-01-01 01:00:00.000000000 +0100 @@ -1,276 +0,0 @@ -#!/usr/bin/env zsh - -# Automatically make .deb package from a commit or a tag. -# -# Prerequisites: -# zsh, build-essential, devscripts, debhelper (>= 9) -# -# Reference: https://wiki.debian.org/IntroDebianPackaging. - -setopt errexit noshwordsplit nobashrematch -[[ -n $DEBUG ]] && setopt xtrace - -################### SET UP ENVIRONMENT AND BASE DIRECTORIES #################### - -[[ -z $DEBFULLNAME ]] && DEBFULLNAME='Arun Prakash Jana' -[[ -z $DEBEMAIL ]] && DEBEMAIL='engineera...@gmail.com' -[[ -z $TZ ]] && TZ='Asia/Kolkata' -export DEBFULLNAME DEBEMAIL TZ - -here=$0:A:h -repodir=$here/.. -builddir=$here/../build -distdir=$here/../dist - -export GIT_DIR=$repodir/.git - -################################# SET UP TRAPS ################################# - -# Trap SIGUSR1: Abort program when functions called from within command -# substitutions in heredocs fail. -trap 'print_error "Encountered problem inside cmdsubst at line $LINENO."; exit 1' SIGUSR1 -export NOTIFY_PID=$$ - -############################### HELPER FUNCTIONS ############################### - -print_error () print -R $'\e[31m'"Error: $*"$'\e[0m' >&2 - -print_warning () print -R $'\e[33m'"Warning: $*"$'\e[0m' >&2 - -# Usage: apt_package_version <package_name> -apt_package_version () { - local version="${$(apt-cache show $1 | grep '^Version')#Version: }" || { - print_error "Version info not available for package ${(q-)1}." - [[ -n $NOTIFY_PID ]] && kill -SIGUSR1 $NOTIFY_PID - exit 1 - } - printf %s $version -} - -debian_policy_version () { - local full_version="$(apt_package_version debian-policy)" - local match - [[ $full_version =~ ^(([0-9]+\.){2}[0-9]+) ]] || { - print_error "Invalid debian-policy version ${(q-)full_version}." - [[ -n $NOTIFY_PID ]] && kill -SIGUSR1 $NOTIFY_PID - exit 1 - } - printf %s $match[1] -} - -# Git helpers - -# Usage: git_normalize_commitish <commit-ish> -# -# Normalize a commit-ish to a tag name if the commit-ish refers to a tag or -# tagged commit; otherwise to a SHA (via git-rev-parse). -git_normalize_commitish () { - local tagname commitsha - if tagname=$(git describe --exact --tags $1 2>/dev/null); then - printf %s $tagname - else - commitsha=$(git rev-parse --verify --quite $1) || { - print_error "Unable to parse ${(q-)1} as a git commit." - [[ -n $NOTIFY_PID ]] && kill -SIGUSR1 $NOTIFY_PID - exit 1 - } - printf %s $commitsha - fi -} - -# Usage: git_ref_is_tag <refname> -# -# Returns 0 (is tag) or 1 (not tag). -git_ref_is_tag () { - git show-ref --quiet --verify refs/tags/$1 -} - -# Usage: git_commitish_timestamp <normalized_commitish> -# -# Expects a normalized commit-ish (see git_normalize_commitish) as input, and -# outputs a timestamp. For a tag, the timestamp is the tagger date. For a -# commit, the timestamp is the committer date. -git_commitish_timestamp () { - if git_ref_is_tag $1; then - local date="$(git for-each-ref --format='%(taggerdate)' refs/tags/$1)" - - # The date returned by git-for-each-ref looks like `Sat Apr 23 10:38:27 - # 2016 +0530', which isn't recognized by date(1) from coreutils. Need a - # hack to turn `+0530' into `U+0530' (same for -). - # - # Note that date will be empty if the tag at question is a lightweight - # tag (i.e., non-annotated) because they don't carry any tagger - # information; in that case we simply fall back to the committer. - if [[ -n $date ]]; then - date -d ${${date// -/ U-}// +/ U+} +%s - return - fi - fi - git rev-list --format=format:%ct --max-count=1 $1 | tail -n1 -} - -######################### PARSE COMMAND LINE ARGUMENTS ######################### - -tag_only=0 -while [[ $1 == -* ]]; do - case $1 in - -h|--help) - cat >&2 <<EOF -Usage: $0:t [options] [<commit-ish>] - -Make a deb package from a git commit-ish, which defaults to HEAD. - -Options: - -h, --help - Print this help and exit. - --tag-only - Only make deb if HEAD (or <commit-ish>, if specified) is a tag or a - tagged commit. -EOF - exit 1 - ;; - --tag-only) - tag_only=1 - ;; - --) - shift - break - ;; - *) - print_error "Unknown option ${(q-)1}." - exit 1 - ;; - esac - shift -done - -[[ -n $1 ]] && { commitish=$1; shift } || commitish=HEAD -(( $# > 0 )) && { - print_error 'Unrecognized arguments' ${(q-)@} - exit 1 -} - -##################################### MAIN ##################################### - -mkdir -p $builddir $distdir -cd $builddir - -normalized_commitish=$(git_normalize_commitish $commitish) -git_ref_is_tag $normalized_commitish && commitish_is_tag=1 || commitish_is_tag=0 - -(( tag_only && !commitish_is_tag )) && { - print_warning "${(q-)commitish} is not a tag or tagged commit, skipping build." - exit -} - -pkgname=imgp -version="${$(git describe --tags $commitish)#v}" # Quoting just to make sh-mode happy -[[ -n $version ]] || { - print_error 'Failed to extract version information.' - exit 1 -} -debrevision=1 -creation_timestamp=$(git_commitish_timestamp $normalized_commitish) - -upstream_tarball=$builddir/${pkgname}_${version}.orig.tar.gz -buildsubdirname=${pkgname}-${version} -git -C $repodir archive --format=tar.gz --prefix=$buildsubdirname/ --output=$upstream_tarball $commitish . -rm -rf $buildsubdirname -tar xf $upstream_tarball - -cd $buildsubdirname -mkdir debian - -# Write debian/changelog - -if (( commitish_is_tag )); then - # Tag -- point to the release - changelog_url=https://github.com/jarun/imgp/releases/tag/$normalized_commitish -else - # Just a commit -- point to the list of commits in the tree - changelog_url=https://github.com/jarun/imgp/commits/$normalized_commitish -fi -cat >debian/changelog <<EOF -$pkgname (${version}-${debrevision}) UNRELEASED; urgency=medium - - * See full changelog at - $changelog_url - - -- $DEBFULLNAME <$DEBEMAIL> $(date --rfc-2822 --date=@$creation_timestamp) -EOF - -# Alternatively, use dch to create changelog interactively: -# dch --create -v ${version}-${debrevision} --package $pkgname - -# Write debian/compat -cat >debian/compat <<'EOF' -9 -EOF - -# Write debian/control -cat >debian/control <<EOF -Source: $pkgname -Maintainer: $DEBFULLNAME <$DEBEMAIL> -Section: misc -Priority: optional -Standards-Version: $(debian_policy_version) -Build-Depends: debhelper (>= 9) - -Package: $pkgname -Architecture: all -Depends: \${shlibs:Depends}, \${misc:Depends}, python3 (>= 3.5), python3-pil -Description: Powerful command-line bookmark manager - See https://github.com/jarun/imgp#readme. -EOF - -# Write debian/copyright -copyright_file=$builddir/$buildsubdirname/debian/copyright -cat >debian/copyright <<EOF -Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ -Upstream-Name: $pkgname -Upstream-Contact: $DEBFULLNAME <$DEBEMAIL> -Source: https://github.com/jarun/imgp - -Files: * -Copyright: 2015-2017 Arun Prakash Jana -License: GPL-3 - 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 published by the Free - Software Foundation. - . - This program is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU General Public License for more - details. - . - You should have received a copy of the GNU General Public License along with - this program. If not, see <http://www.gnu.org/licenses/>. - . - On Debian systems, the full text of the GNU General Public License version 3 - can be found in the file '/usr/share/common-licenses/GPL-3'. -EOF - -# Write debian/rules -cat >debian/rules <<EOF -#!/usr/bin/make -f -%: - dh \$@ - -override_dh_auto_install: - \$(MAKE) DESTDIR=\$\$(pwd)/debian/$pkgname PREFIX=/usr install - cp -p ${(q-)copyright_file} \$\$(pwd)/debian/$pkgname/usr/share/doc/$pkgname/copyright -EOF -chmod +x debian/rules - -# Write debian/source/format -mkdir -p debian/source -cat >debian/source/format <<'EOF' -3.0 (quilt) -EOF - -# Build binary package -debuild -us -uc - -# Copying deb to dist -binary_package=$builddir/${pkgname}_${version}-${debrevision}_all.deb -cp -p $binary_package $distdir