simple-image-reducer-master/0000775000175000017500000000000013546673341015657 5ustar takakitakakisimple-image-reducer-master/AUTHORS0000664000175000017500000000011513546673341016724 0ustar takakitakakiKonstantin Korikov Henry Thasler simple-image-reducer-master/COPYING0000664000175000017500000004311013546673341016711 0ustar takakitakaki GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. simple-image-reducer-master/ChangeLog0000664000175000017500000000452713546673341017441 0ustar takakitakaki2015-01-17 18:35 Henry * [r24] Makefile: Changed version to 1.0.3. 2010-12-24 16:19 lostclus * [r23] Makefile: Changed version to 1.0.2. 2010-12-24 16:17 lostclus * [r22] simple-image-reducer.py: Disable the Execute button if input files list is empty. 2010-12-24 15:47 lostclus * [r21] po/ru.po, po/uk.po, simple-image-reducer.py: Fixed license link. 2010-12-24 15:14 lostclus * [r20] simple-image-reducer.py: Fixed bug with localized filenames and filenames with spaces and other non-alphanumeric characters. 2010-12-21 21:38 lostclus * [r19] README: Description was updated. 2010-12-15 16:07 lostclus * [r17] ChangeLog: ChangeLog updated. 2010-12-15 16:04 lostclus * [r16] ChangeLog, Makefile: Added ChangeLog. 2010-12-15 16:01 lostclus * [r15] po/uk.po: Translations updated. 2010-12-15 15:57 lostclus * [r14] Makefile, po/Makefile, simple-image-reducer.spec.in: Fixed version substitution in .spec. Added uninstall rule. Run update-desktop-database and gtk-update-icon-cache on install and uninstall. 2010-12-15 15:09 lostclus * [r13] simple-image-reducer.desktop.in: Fixed comment. 2010-12-15 15:07 lostclus * [r12] Makefile: Changed version to 1.0.1. 2010-12-13 00:14 lostclus * [r10] Makefile: Include .spec.in into distribution. 2010-12-13 00:10 lostclus * [r9] po/uk.po: Translations updated. 2010-12-13 00:06 lostclus * [r8] po/ru.po: Translations updated. 2010-12-13 00:05 lostclus * [r7] po/ru.po, po/uk.po: Translations updated. 2010-12-12 23:13 lostclus * [r6] README: README updated. 2010-12-12 22:43 lostclus * [r5] simple-image-reducer.py: Fixed output file extension when changing output format. 2010-12-12 21:26 lostclus * [r4] README, simple-image-reducer.spec.in: Description updated. Spec updated. 2010-12-11 12:01 lostclus * [r3] simple-image-reducer.py, simple-image-reducer.spec.in: Changed web site to http://simple-image-reducer.org.ua. 2010-12-11 11:58 lostclus * [r2] AUTHORS, COPYING, Makefile, README, simple-image-reducer.spec.in: Added README, COPYING, AUTHORS. Fixed requirements in .spec. 2010-12-11 02:15 lostclus * [r1] ., Makefile, po, po/Makefile, po/ru.po, simple-image-reducer.desktop.in, simple-image-reducer.png, simple-image-reducer.py, simple-image-reducer.spec.in, simple-image-reducer.svg: Initial import. simple-image-reducer-master/Makefile0000664000175000017500000000561413546673341017325 0ustar takakitakakiPKGNAME=simple-image-reducer VERSION=1.0.3 SUBDIRS=po PREFIX=/usr BINDIR=${PREFIX}/bin DATADIR=${PREFIX}/share all: simple-image-reducer $(PKGNAME).desktop po/$(PKGNAME).pot:: subdirs subdirs: $(PKGNAME).desktop.in.h for d in $(SUBDIRS); do make -C $$d; [ $$? = 0 ] || exit 1; done simple-image-reducer: simple-image-reducer.py sed "s/@VERSION@/$(VERSION)/g" $< >$@ %.desktop.in.h: %.desktop.in intltool-extract --type=gettext/ini $< %.desktop: %.desktop.in po/$(PKGNAME).pot po/*.po intltool-merge -u -d po/ $< $@ simple-image-reducer.spec: simple-image-reducer.spec.in Makefile sed "s/@VERSION@/$(VERSION)/g" simple-image-reducer.spec.in >$@ install: all mkdir -p $(DESTDIR)$(BINDIR) mkdir -p $(DESTDIR)$(DATADIR)/pixmaps mkdir -p $(DESTDIR)$(DATADIR)/applications mkdir -p $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps mkdir -p $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps install -m 0755 simple-image-reducer $(DESTDIR)$(BINDIR) install -m 0644 ${PKGNAME}.desktop $(DESTDIR)$(DATADIR)/applications/${PKGNAME}.desktop install -m 0644 ${PKGNAME}.png $(DESTDIR)$(DATADIR)/pixmaps install -m 0644 ${PKGNAME}.png $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps install -m 0644 ${PKGNAME}.svg $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps touch --no-create $(DESTDIR)$(DATADIR)/icons/hicolor for d in $(SUBDIRS); do \ (cd $$d; $(MAKE) DESTDIR=$(DESTDIR) install) \ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" [ -z "$(DESTDIR)" ] && update-desktop-database -q || true [ -z "$(DESTDIR)" ] && gtk-update-icon-cache $(DATADIR)/icons/hicolor || true uninstall: rm -f $(DESTDIR)$(BINDIR)/simple-image-reducer rm -f $(DESTDIR)$(DATADIR)/applications/${PKGNAME}.desktop rm -f $(DESTDIR)$(DATADIR)/pixmaps/${PKGNAME}.png rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/48x48/apps/${PKGNAME}.png rm -f $(DESTDIR)$(DATADIR)/icons/hicolor/scalable/apps/${PKGNAME}.svg for d in $(SUBDIRS); do \ (cd $$d; $(MAKE) DESTDIR=$(DESTDIR) uninstall) \ || case "$(MFLAGS)" in *k*) fail=yes;; *) exit 1;; esac; \ done && test -z "$$fail" touch --no-create $(DESTDIR)$(DATADIR)/icons/hicolor [ -z "$(DESTDIR)" ] && update-desktop-database -q || true [ -z "$(DESTDIR)" ] && gtk-update-icon-cache $(DATADIR)/icons/hicolor || true dist: $(PKGNAME).spec mkdir -p .dist/${PKGNAME}-${VERSION} cp -a Makefile \ AUTHORS COPYING README ChangeLog \ ${PKGNAME}.py \ ${PKGNAME}.desktop.in \ ${PKGNAME}.png \ ${PKGNAME}.svg \ ${PKGNAME}.spec \ ${PKGNAME}.spec.in \ .dist/${PKGNAME}-${VERSION} mkdir -p .dist/${PKGNAME}-${VERSION}/po cp -a po/Makefile \ po/${PKGNAME}.pot \ po/*.po po/*.mo \ .dist/${PKGNAME}-${VERSION}/po cd .dist && tar cjf ../${PKGNAME}-${VERSION}.tar.bz2 ${PKGNAME}-${VERSION} rm -rf .dist clean: @rm -fv *~ @rm -fv *.pyc @rm -fv simple-image-reducer @rm -fv simple-image-reducer.desktop simple-image-reducer.desktop.in.h simple-image-reducer-master/README.md0000664000175000017500000000153213546673341017137 0ustar takakitakaki# Simple Image Reducer based on the work of Konstantin Korikov. reduce and rotate images in three-four clicks. Simple Image Reducer is an GTK application to easily reduce and rotate images. It can be useful for processing digital photos before sending by email or uploading on the Web. Image files can be supplied to the application from the file manager using the context menu "Open with...", or dragging files to the main window. Requirements: * Linux or other Unix-like OS * Python >= 2.4 * PyGTK >= 2.12 * Python Imaging Library (PIL) To install the program type in the console: make install References * http://simple-image-reducer.org.ua/en/ * http://stackoverflow.com/questions/17042602/preserve-exif-data-of-image-with-pil-when-resizecreate-thumbnail * http://effbot.org/imagingbook/ * https://packages.debian.org/sid/simple-image-reducer simple-image-reducer-master/po/0000775000175000017500000000000013546673341016275 5ustar takakitakakisimple-image-reducer-master/po/Makefile0000664000175000017500000000403313546673341017735 0ustar takakitakaki# # Makefile for the PO files (translation) catalog # TOP = ../.. # What is this package? NLSPACKAGE = simple-image-reducer POTFILE = $(NLSPACKAGE).pot INSTALL = /usr/bin/install -c INSTALL_DATA = $(INSTALL) -m 644 INSTALL_DIR = /usr/bin/install -d # destination directory INSTALL_NLS_DIR = $(DESTDIR)/usr/share/locale # commands DIFF = /usr/bin/diff GREP = /bin/grep # PO catalog handling MSGMERGE = msgmerge -v -N XGETTEXT = xgettext --default-domain=$(NLSPACKAGE) \ --add-comments --from-code=utf-8 MSGFMT = msgfmt --statistics --verbose # What do we need to do POFILES = $(wildcard *.po) MOFILES = $(patsubst %.po,%.mo,$(POFILES)) PYSRC = $(wildcard ../*.py) SRCFILES = $(PYSRC) all:: update-po $(MOFILES) po_diff_and_mv_or_rm = \ if [ ! -f "$(1)" ] || ($(DIFF) "$(1)" "$(2)" | $(GREP) -v '^. "POT-Creation-Date:' | $(GREP) -q '^[<>] [^\#]'); then \ echo "Creating/updating $(1)"; \ mv -f $(2) $(1); \ else \ rm -f $(2); \ fi po_diff_and_mv_or_rm_func = \ function po_diff_and_mv_or_rm () { \ $(call po_diff_and_mv_or_rm,$$1,$$2) \ } $(POTFILE): $(SRCFILES) $(XGETTEXT) --keyword=_ --keyword=N_ $(SRCFILES) @$(call po_diff_and_mv_or_rm,$(POTFILE),$(NLSPACKAGE).po) update-po: Makefile $(POTFILE) refresh-po refresh-po: Makefile @$(po_diff_and_mv_or_rm_func); \ for cat in $(POFILES); do \ lang=`basename $$cat .po`; \ if $(MSGMERGE) $$lang.po $(POTFILE) > $$lang.pot ; then \ echo "$(MSGMERGE) of $$lang succeeded" ; \ po_diff_and_mv_or_rm $$lang.po $$lang.pot; \ else \ echo "$(MSGMERGE) of $$lang failed" ; \ rm -f $$lang.pot ; \ fi; \ done clean: @rm -fv *mo *~ .depend install: $(MOFILES) @for n in $(MOFILES); do \ l=`basename $$n .mo`; \ $(INSTALL_DIR) $(INSTALL_NLS_DIR)/$$l/LC_MESSAGES; \ $(INSTALL_DATA) --verbose $$n $(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/$(NLSPACKAGE).mo; \ done uninstall: @for n in $(MOFILES); do \ l=`basename $$n .mo`; \ rm -f $(INSTALL_NLS_DIR)/$$l/LC_MESSAGES/$(NLSPACKAGE).mo; \ done %.mo: %.po $(MSGFMT) -o $@ $< .PHONY: missing depend simple-image-reducer-master/po/ru.po0000664000175000017500000002070713546673341017271 0ustar takakitakaki# vim:spell:spelllang=ru # Simple Image Reducer - Reduce and rotate images in three-four clicks # Copyright (C) 2010 Konstantin Korikov # This file is distributed under the same license as the Simple Image Reducer # package. # Konstantin Korikov , 2010. # msgid "" msgstr "" "Project-Id-Version: Simple Image Reducer 1.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-12-24 17:38+0200\n" "PO-Revision-Date: 2010-12-11 02:20+0200\n" "Last-Translator: Konstantin Korikov \n" "Language-Team: Russian\n" "Language: ru\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" #: ../simple-image-reducer.py:61 ../simple-image-reducer.py:289 msgid "Simple Image Reducer" msgstr "Простой преобразователь изображений" #: ../simple-image-reducer.py:73 msgid "Input Files:" msgstr "Входные файлы" #: ../simple-image-reducer.py:87 msgid "Drag image files here" msgstr "Перетащите сюда файлы изображений" #: ../simple-image-reducer.py:102 msgid "File" msgstr "Файл" #: ../simple-image-reducer.py:114 msgid "Add files..." msgstr "Добавить файлы..." #: ../simple-image-reducer.py:122 msgid "Remove files" msgstr "Удалить файлы" #: ../simple-image-reducer.py:129 msgid "Fit to:" msgstr "Подогнать под:" #: ../simple-image-reducer.py:136 msgid "Select a maximum width and height" msgstr "Выберите максимальную ширину и высоту" #: ../simple-image-reducer.py:138 ../simple-image-reducer.py:232 msgid "No change" msgstr "Не менять" #: ../simple-image-reducer.py:166 msgid "Rotate:" msgstr "Повернуть:" #: ../simple-image-reducer.py:173 msgid "Select a rotation method" msgstr "Выберите метод вращения" #: ../simple-image-reducer.py:175 msgid "No rotate" msgstr "Не поворачивать" #: ../simple-image-reducer.py:176 msgid "90° clockwise" msgstr "На 90° по часовой стрелке" #: ../simple-image-reducer.py:177 msgid "180°" msgstr "На 180°" #: ../simple-image-reducer.py:178 msgid "90° counter-clockwise" msgstr "На 90° против часовой стрелки" #: ../simple-image-reducer.py:179 msgid "According to EXIF data" msgstr "Согласно данным EXIF" #: ../simple-image-reducer.py:195 msgid "Output files:" msgstr "Выходные файлы:" #: ../simple-image-reducer.py:207 msgid "Modify images in place" msgstr "Изменить изображения на месте" #: ../simple-image-reducer.py:224 msgid "Output format:" msgstr "Выходной формат:" #: ../simple-image-reducer.py:233 msgid "BMP" msgstr "BMP" #: ../simple-image-reducer.py:234 msgid "GIF" msgstr "GIF" #: ../simple-image-reducer.py:235 msgid "JPEG" msgstr "JPEG" #: ../simple-image-reducer.py:236 msgid "PNG" msgstr "PNG" #: ../simple-image-reducer.py:237 msgid "PPM" msgstr "PPM" #: ../simple-image-reducer.py:238 msgid "TIFF" msgstr "TIFF" #: ../simple-image-reducer.py:291 msgid "Reduce and rotate images in three-four clicks." msgstr "Уменьшает и поворачивает изображения в три-четыре клика." #: ../simple-image-reducer.py:293 msgid "(c) Copyright 2010 Konstantin Korikov" msgstr "(c) Copyright 2010 Кориков Константин" #: ../simple-image-reducer.py:294 msgid "" "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" "the Free Software Foundation; either version 2 of the License, or\n" "(at your option) any later version.\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" " \n" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, see http://www.gnu.org/licenses/" msgstr "" "Данная программа является свободным ПО. Вы вправе распространять и/или\n" "модифицировать ее в рамках условий лицензии GNU General Public License\n" "опубликованной Free Software Foundation версии 2 либо (на Ваш выбор)\n" "более поздней версии.\n" "\n" "Программа распространяеся в надежде на то, что она будет полезна, однако\n" "НЕ ПРЕДОСТАВЛЯЕТСЯ НИКАКИХ ГАРАНТИЙ, в том числе ГАРАНТИИ ТОВАРНОГО\n" "СОСТОЯНИЯ ПРИ ПРОДАЖЕ и ПРИГОДНОСТИ ДЛЯ ИСПОЛЬЗОВАНИЯ В КОНКРЕТНЫХ\n" "ЦЕЛЯХ. Для получения более подробной информации ознакомьтесь с \n" "GNU General Public License.\n" "\n" "Вместе с данной программой вы должны были получить экземпляр GNU General\n" "Public License. Если нет, смотрите http://www.gnu.org/licenses/" #: ../simple-image-reducer.py:333 msgid "Add File..." msgstr "Добавить файл..." #: ../simple-image-reducer.py:340 msgid "Image Files" msgstr "Файлы изображений" #: ../simple-image-reducer.py:350 msgid "All Files" msgstr "Все файлы" #: ../simple-image-reducer.py:384 #, python-format msgid "Append \"-%s\" to the file base name" msgstr "Добавить \"-%s\" к базовому имени файла" #: ../simple-image-reducer.py:386 #, python-format msgid "Save to \"%s\" subdirectory" msgstr "Сохранить в подкаталог \"%s\"" #: ../simple-image-reducer.py:390 #, python-format msgid "%(current)d of %(total)d images processed" msgstr "Обработано %(current)d из %(total)d изображений" #: ../simple-image-reducer.py:394 #, python-format msgid "%d images to process" msgstr "%d изображений для обработки" #: ../simple-image-reducer.py:437 #, python-format msgid "Cannot identify image file: %s" msgstr "Невозможно определить тип изображения: %s" #: ../simple-image-reducer.py:439 #, python-format msgid "Unable to open file: %s" msgstr "Не открывается файл: %s" #: ../simple-image-reducer.py:469 #, python-format msgid "Unable to open file for writing: %s" msgstr "Не открывается файл для записи: %s" #~ msgid "" #~ "This program is free software; you can redistribute it and/or modify\n" #~ "it under the terms of the GNU General Public License as published by\n" #~ "the Free Software Foundation; either version 2 of the License, or\n" #~ "(at your option) any later version.\n" #~ "\n" #~ "This program is distributed in the hope that it will be useful,\n" #~ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" #~ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" #~ "GNU General Public License for more details.\n" #~ " \n" #~ "You should have received a copy of the GNU General Public License\n" #~ "along with this program; if not, see ." #~ msgstr "" #~ "Данная программа является свободным ПО. Вы вправе распространять и/или\n" #~ "модифицировать ее в рамках условий лицензии GNU General Public License\n" #~ "опубликованной Free Software Foundation версии 2 либо (на Ваш выбор) " #~ "более\n" #~ "поздней версии.\n" #~ "\n" #~ "Программа распространяеся в надежде на то, что она будет полезна, однако " #~ "НЕ\n" #~ "ПРЕДОСТАВЛЯЕТСЯ НИКАКИХ ГАРАНТИЙ, в том числе ГАРАНТИИ ТОВАРНОГО " #~ "СОСТОЯНИЯ ПРИ\n" #~ "ПРОДАЖЕ и ПРИГОДНОСТИ ДЛЯ ИСПОЛЬЗОВАНИЯ В КОНКРЕТНЫХ ЦЕЛЯХ. Для получения " #~ "более\n" #~ "подробной информации ознакомьтесь с GNU General Public License.\n" #~ "\n" #~ "Вместе с данной программой вы должны были получить экземпляр GNU General " #~ "Public\n" #~ "License. Если нет, смотрите ." simple-image-reducer-master/po/uk.po0000664000175000017500000002055213546673341017260 0ustar takakitakaki# vim:spell:spelllang=uk # Simple Image Reducer - Reduce and rotate images in three-four clicks # Copyright (C) 2010 Konstantin Korikov # This file is distributed under the same license as the Simple Image Reducer # package. # Konstantin Korikov , 2010. msgid "" msgstr "" "Project-Id-Version: Simple Image Reducer 1.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2010-12-24 17:38+0200\n" "PO-Revision-Date: 2010-12-13 02:03+0300\n" "Last-Translator: Konstantin Korikov \n" "Language-Team: Ukrainian\n" "Language: uk\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" "%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n" "X-Generator: Virtaal 0.6.1\n" #: ../simple-image-reducer.py:61 ../simple-image-reducer.py:289 msgid "Simple Image Reducer" msgstr "Простий перетворювач зображень" #: ../simple-image-reducer.py:73 msgid "Input Files:" msgstr "Вхідні файли:" #: ../simple-image-reducer.py:87 msgid "Drag image files here" msgstr "Перетягніть сюди файли зображень" #: ../simple-image-reducer.py:102 msgid "File" msgstr "Файл" #: ../simple-image-reducer.py:114 msgid "Add files..." msgstr "Додати файли..." #: ../simple-image-reducer.py:122 msgid "Remove files" msgstr "Вилучити файли" #: ../simple-image-reducer.py:129 msgid "Fit to:" msgstr "Підігнати під:" #: ../simple-image-reducer.py:136 msgid "Select a maximum width and height" msgstr "Виберіть максимальну ширину і висоту" #: ../simple-image-reducer.py:138 ../simple-image-reducer.py:232 msgid "No change" msgstr "Без змін" #: ../simple-image-reducer.py:166 msgid "Rotate:" msgstr "Повернути:" #: ../simple-image-reducer.py:173 msgid "Select a rotation method" msgstr "Виберіть метод обертання" #: ../simple-image-reducer.py:175 msgid "No rotate" msgstr "Без змін" #: ../simple-image-reducer.py:176 msgid "90° clockwise" msgstr "На 90° за годинниковою стрілкою" #: ../simple-image-reducer.py:177 msgid "180°" msgstr "На 180°" #: ../simple-image-reducer.py:178 msgid "90° counter-clockwise" msgstr "90° проти годинникової стрілки" #: ../simple-image-reducer.py:179 msgid "According to EXIF data" msgstr "Відповідно до даних EXIF" #: ../simple-image-reducer.py:195 msgid "Output files:" msgstr "Вихідні файли:" #: ../simple-image-reducer.py:207 msgid "Modify images in place" msgstr "Змінити зображення на місці" #: ../simple-image-reducer.py:224 msgid "Output format:" msgstr "Вихідний формат:" #: ../simple-image-reducer.py:233 msgid "BMP" msgstr "BMP" #: ../simple-image-reducer.py:234 msgid "GIF" msgstr "GIF" #: ../simple-image-reducer.py:235 msgid "JPEG" msgstr "JPEG" #: ../simple-image-reducer.py:236 msgid "PNG" msgstr "PNG" #: ../simple-image-reducer.py:237 msgid "PPM" msgstr "PPM" #: ../simple-image-reducer.py:238 msgid "TIFF" msgstr "TIFF" #: ../simple-image-reducer.py:291 msgid "Reduce and rotate images in three-four clicks." msgstr "Зменшення і обертання зображень в три-чотири клацання." #: ../simple-image-reducer.py:293 msgid "(c) Copyright 2010 Konstantin Korikov" msgstr "(c) Copyright 2010 Коріков Костянтин" #: ../simple-image-reducer.py:294 msgid "" "This program is free software; you can redistribute it and/or modify\n" "it under the terms of the GNU General Public License as published by\n" "the Free Software Foundation; either version 2 of the License, or\n" "(at your option) any later version.\n" "\n" "This program is distributed in the hope that it will be useful,\n" "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" " \n" "You should have received a copy of the GNU General Public License\n" "along with this program; if not, see http://www.gnu.org/licenses/" msgstr "" "Ця програма є вільним програмним забезпеченням. Ви маєте право\n" "розповсюджувати її в рамах умови GNU General Public License,\n" "опублікованій через Free Software Foundation, версія 2 або (на\n" "Ваш вибір) будь-яка інша пізніша версія.\n" "\n" "Програма поширюється в надії на те, що вона буде корисна, однак\n" "не надає ЖОДНОЇ ГАРАНТІЇ, у тому числі ГАРАНТІЇ ТОВАРНОГО СТАНУ\n" "ДЛЯ ПРОДАЖІ і ПРИДАТНОСТІ ДО ВИКОРИСТАННЯ В ПЕВНИХ ЦІЛЯХ. Для\n" "отримання більш детальної інформації ознайомтеся з GNU General\n" "Public License.\n" "\n" "Ви повинні отримати копію GNU General Public License разом з цією\n" "програмою. Якщо ні, то дивіться http://www.gnu.org/licenses/" #: ../simple-image-reducer.py:333 msgid "Add File..." msgstr "Додати файл..." #: ../simple-image-reducer.py:340 msgid "Image Files" msgstr "Файли зображень" #: ../simple-image-reducer.py:350 msgid "All Files" msgstr "Всі файли" #: ../simple-image-reducer.py:384 #, python-format msgid "Append \"-%s\" to the file base name" msgstr "Додати \"-%s\" до імені файлу" #: ../simple-image-reducer.py:386 #, python-format msgid "Save to \"%s\" subdirectory" msgstr "Зберегти в підкаталозі \"%s\"" #: ../simple-image-reducer.py:390 #, python-format msgid "%(current)d of %(total)d images processed" msgstr "%(current)d з %(total)d зображень оброблено" #: ../simple-image-reducer.py:394 #, python-format msgid "%d images to process" msgstr "%d зображень для обробки" #: ../simple-image-reducer.py:437 #, python-format msgid "Cannot identify image file: %s" msgstr "Не можу визначити файл зображення: %s" #: ../simple-image-reducer.py:439 #, python-format msgid "Unable to open file: %s" msgstr "Не вдається відкрити файл: %s" #: ../simple-image-reducer.py:469 #, python-format msgid "Unable to open file for writing: %s" msgstr "Неможливо відкрити файл для запису: %s" #~ msgid "" #~ "This program is free software; you can redistribute it and/or modify\n" #~ "it under the terms of the GNU General Public License as published by\n" #~ "the Free Software Foundation; either version 2 of the License, or\n" #~ "(at your option) any later version.\n" #~ "\n" #~ "This program is distributed in the hope that it will be useful,\n" #~ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" #~ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" #~ "GNU General Public License for more details.\n" #~ " \n" #~ "You should have received a copy of the GNU General Public License\n" #~ "along with this program; if not, see ." #~ msgstr "" #~ "Ця програма є вільним програмним забезпеченням. Ви маєте право\n" #~ "розповсюджувати її в рамах умови GNU General Public License, " #~ "опублікованій\n" #~ "через Free Software Foundation, версія 2 або (на Ваш вибір) будь-яка " #~ "інша\n" #~ "пізніша версія.\n" #~ "\n" #~ "Програма поширюється в надії на те, що вона буде корисна, однак не надає\n" #~ "ЖОДНОЇ ГАРАНТІЇ, у тому числі ГАРАНТІЇ ТОВАРНОГО СТАНУ ДЛЯ ПРОДАЖІ і\n" #~ "ПРИДАТНОСТІ ДО ВИКОРИСТАННЯ В ПЕВНИХ ЦІЛЯХ. Для отримання більш " #~ "детальної\n" #~ "інформації ознайомтеся з GNU General Public License.\n" #~ "\n" #~ "Ви повинні отримати копію GNU General Public License разом з цією " #~ "програмою.\n" #~ "Якщо ні, то дивіться ." simple-image-reducer-master/simple-image-reducer.desktop.in0000664000175000017500000000065413546673341023664 0ustar takakitakaki[Desktop Entry] _Name=Simple Image Reducer _Comment=Reduce and rotate images in three-four clicks. Exec=simple-image-reducer %U Icon=simple-image-reducer.png Terminal=false Type=Application Categories=Graphics;2DGraphics;RasterGraphics;GTK; MimeType=image/bmp;image/gif;image/x-portable-anymap;image/x-portable-bitmap;image/x-portable-graymap;image/x-portable-pixmap;image/x-tga;image/x-xbitmap;image/tiff;image/jpeg;image/png; simple-image-reducer-master/simple-image-reducer.png0000664000175000017500000000551213546673341022370 0ustar takakitakakiPNG  IHDR00WsBIT|d pHYs B(xtEXtSoftwarewww.inkscape.org< IDATh՚klTl;LUJȣ-QT^G BG$zo> b"%BKb H鋶L)mv}?s:g9ý{_+5!0ӐIπ@r3q?$E3qӇcO# ,3ŚB(o>#ߓ kEhmmf5 3&K5%obQ+BP,$ɜDuWP!Or|Ox5^g0mmƇzBf`s*oOWeeߌ#񙌶f}4ɖdL ،6,F f49@hgD" !", LqJ13av0;i @Iz m=mj=qq.]RE"fdrd QQ0u!| V&,.S|!].<i4ӈ7ƫLL]ttR(rLv VR1qYM&N䏎?v=DUl[63g23i&q&% X{y-FHHRD@/r9X Ml>ȩ{\LSOߟ|U\xk[d253m,kT BB:`)SyTߴ B:4IvHB"ֳ,}9;AgS^;ٚ$U`DS(SH GJ1+x'fޡ5]."Ⱦ}{]inUmUD,f  ݅1sw/v{j("+r ,;9~^~1יitGz=u:jjQUӋ)sB=kkn=Myc-4Y~n9N>#hT!zJ_%v #_ICz=zjUcf7Fbs2JB =NͧU xuNuNn c6SOp,M[݄E7g=c;NnaIƒ^gt7:=VWvsu!U#W1>Q{%V3<"6]DIc $YTD!I2=Uq4@g|LLAiUԑda09>N )t[l@U(Z͉1 Bw#3^٩e mQ:(4JI)1clgW.QQW>n]"ukm=m#6]inaͺ(Tq-'tGc e e5i;0P )U:u7s#33ݫڅ7]DKE)Tz:Ϫ>bE];/~\L\XCHS!lQ5GkQH| tLON#ʎJ~T -^'R 9.Y^OI!Piu xT0 EwXwaB*Vp UC>PzX#9u@!HDRH.٤$8sE3Ē/Ask:CBRTdd#xЄMP%HHs<(()q5,އ4e 4_ S0%i l젣5Tx+8y$[/ Unw8-NiI¾0m3sյ=I&cL m\!BTx+8q"q  !Go%xn lbgךV+&ב躮Se hZ5~BDpgPcmy 䱿22IENDB`simple-image-reducer-master/simple-image-reducer.py0000755000175000017500000004446213546673341022244 0ustar takakitakaki#!/usr/bin/env python # -*- coding:utf-8 -*- # Simple Image Reducer - Reduce and rotate images in three-four clicks # Copyright (C) 2010 Konstantin Korikov # Copyright (c) 2015 Henry Thasler # 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 # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # 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, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import sys import os import os.path import urllib.request, urllib.parse, urllib.error import urllib.parse import configparser from PIL import Image from PIL.ExifTags import TAGS import gettext _ = lambda x: gettext.dgettext('simple-image-reducer', x) import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk from gi.repository import Gdk from gi.repository import GObject version = '@VERSION@' class MainWindow(Gtk.Window): def __init__(self, argv): GObject.GObject.__init__(self) self.cfg_filename = os.path.expanduser( os.path.join('~', '.config', 'simple-image-reducer', 'options')) self.cfg = configparser.ConfigParser() self.cfg.add_section('last_used') self.cfg.set('last_used', 'resolution', '') self.cfg.set('last_used', 'rotate', 'exif') self.cfg.set('last_used', 'output_type', 'append') self.cfg.set('last_used', 'output_format', '') self.cfg.add_section('options') self.cfg.set('options', 'resolutions', '32x32,48x48,64x64,128x128,256x256,400x400,480x480,512x512,640x640,800x800,1024x1024,1280x1280,1600x1600,1800x1800,1920x1920,2048x2048') self.cfg.read(self.cfg_filename) self.task = None self.processed_count = 0 self.connect('destroy', self.destroy) self.set_title(_("Simple Image Reducer")) self.set_icon_name('simple-image-reducer') vbox = Gtk.VBox() self.add(vbox) table = Gtk.Grid() table.set_row_spacing(5) table.set_column_spacing(5) table.set_border_width(10) vbox.pack_start(table, True, True, True) label = Gtk.Label(label=_("Input Files:")) label.set_xalign(0) label.set_yalign(0.5) table.attach(label, 0, 0, 2, 1) sw = Gtk.ScrolledWindow() sw.set_shadow_type(Gtk.ShadowType.IN) sw.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC) table.attach(sw, 0, 1, 2, 1) self.input_files = Gtk.TreeView() self.input_files.set_tooltip_text(_("Drag image files here")) sw.add(self.input_files) self.input_files.set_size_request(-1, 200) self.input_files.get_selection().set_mode(Gtk.SelectionMode.MULTIPLE) self.input_files.set_rubber_banding(True) self.input_files.drag_dest_set( Gtk.DestDefaults.ALL, [Gtk.TargetEntry.new('text/uri-list', 0, 0)], Gdk.DragAction.COPY | Gdk.DragAction.MOVE) self.input_files.connect('drag-data-received', self.on_input_files_drag_data_received) model = Gtk.ListStore(GObject.TYPE_STRING) self.input_files.set_model(model) column = Gtk.TreeViewColumn(_("File"), Gtk.CellRendererText(), text=0) self.input_files.append_column(column) box = Gtk.VButtonBox() box.set_spacing(5) box.set_layout(Gtk.ButtonBoxStyle.START) table.attach(box, 2, 1, 1, 1) button = Gtk.Button.new_from_icon_name("list-add", Gtk.IconSize.BUTTON) button.set_tooltip_text(_("Add files...")) button.connect('clicked', self.on_input_files_add_clicked) box.add(button) button = Gtk.Button.new_from_icon_name("list-remove", Gtk.IconSize.BUTTON) button.set_tooltip_text(_("Remove files")) button.connect('clicked', self.on_input_files_remove_clicked) box.add(button) label = Gtk.Label(label=_("Fit to:")) label.set_xalign(1) label.set_yalign(0.5) table.attach(label, 0, 2, 1, 1) self.resolution = Gtk.ComboBoxText() self.resolution.set_tooltip_text(_("Select a maximum width and height")) self.resolution_map = [ (None, _("No change")), ] for value in self.cfg.get('options', 'resolutions').split(','): text = value.strip() size = tuple([int(x) for x in text.split('x')]) self.resolution_map.append((size, text)) for size, text in self.resolution_map: self.resolution.append_text(text) self.resolution.set_active(0) default = self.cfg.get('last_used', 'resolution') if default: default = tuple([int(x) for x in default.split('x')]) else: default = None for i in range(len(self.resolution_map)): if self.resolution_map[i][0] == default: self.resolution.set_active(i) self.resolution.connect('changed', lambda *args: self.update_output_files()) table.attach(self.resolution, 1, 2, 1, 1) label = Gtk.Label(label=_("Rotate:")) label.set_xalign(1) label.set_yalign(0.5) table.attach(label, 0, 3, 1, 1) self.rotate = Gtk.ComboBoxText() self.rotate.set_tooltip_text(_("Select a rotation method")) self.rotate_map = [ (None, _("No rotate")), ('270', _("90\u00b0 clockwise")), ('180', _("180\u00b0")), ('90', _("90\u00b0 counter-clockwise")), ('exif', _("According to EXIF data")), ] for method, text in self.rotate_map: self.rotate.append_text(text) self.rotate.set_active(0) default = self.cfg.get('last_used', 'rotate') or None for i in range(len(self.rotate_map)): if self.rotate_map[i][0] == default: self.rotate.set_active(i) table.attach(self.rotate, 1, 3, 1, 1) label = Gtk.Label(label=_("Output files:")) label.set_xalign(1) label.set_yalign(0) table.attach(label, 0, 4, 1, 1) box = Gtk.VBox() self.output_type_append = group = Gtk.RadioButton.new_with_label_from_widget(None, "") box.add(self.output_type_append) self.output_type_subdirectory = Gtk.RadioButton.new_with_label_from_widget(group, "") box.add(self.output_type_subdirectory) self.output_type_in_place = Gtk.RadioButton.new_with_label_from_widget(group, _("Modify images in place")) box.add(self.output_type_in_place) default = self.cfg.get('last_used', 'output_type') if default == 'subdirectory': self.output_type_subdirectory.set_active(True) elif default == 'in-place': self.output_type_in_place.set_active(True) else: self.output_type_append.set_active(True) self.update_output_files() table.attach(box, 1, 4, 1, 1) label = Gtk.Label(label=_("Output format:")) label.set_xalign(1) label.set_yalign(0.5) table.attach(label, 0, 5, 1, 1) self.output_format = Gtk.ComboBoxText() self.output_format_map = [ (None, None, _("No change")), ('BMP', '.bmp', _("BMP")), ('GIF', '.gif', _("GIF")), ('JPEG', '.jpg', _("JPEG")), ('PNG', '.png', _("PNG")), ('PPM', '.ppm', _("PPM")), ('TIFF', '.tif', _("TIFF")), ] for fmt, ext, text in self.output_format_map: self.output_format.append_text(text) self.output_format.set_active(0) default = self.cfg.get('last_used', 'output_format') or None for i in range(len(self.output_format_map)): if self.output_format_map[i][0] == default: self.output_format.set_active(i) table.attach(self.output_format, 1, 5, 1, 1) box = Gtk.HButtonBox() box.set_spacing(5) box.set_border_width(5) box.set_layout(Gtk.ButtonBoxStyle.END) table.attach(box, 0, 6, 3, 1) button = Gtk.Button.new_with_mnemonic(_("_Cancel")) button.connect('clicked', self.destroy) box.add(button) button = Gtk.Button.new_with_mnemonic(_("_About")) button.connect('clicked', self.about) box.add(button) self.execute_button = button = Gtk.Button.new_with_mnemonic(_("_Execute")) button.connect('clicked', self.execute) box.add(button) self.statusbar = Gtk.Statusbar() vbox.pack_start(self.statusbar, False, False, False) self.update_status_bar() self.update_buttons() for uri in argv[1:]: self.add_input_file(uri) self.show_all() def destroy(self, *args): Gtk.main_quit() def about(self, *args): dialog = Gtk.AboutDialog() dialog.set_name(_("Simple Image Reducer")) dialog.set_version(version) dialog.set_comments(_("Reduce and rotate images in three-four clicks.")) dialog.set_logo_icon_name('simple-image-reducer') dialog.set_copyright(_("(c) Copyright 2010 Konstantin Korikov")) dialog.set_license(_("""\ 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 the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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/""")) dialog.set_wrap_license(True) dialog.set_website("http://simple-image-reducer.org.ua/") dialog.connect('response', lambda d, r: d.destroy()) dialog.show() def add_input_file(self, path): if path.startswith('file://'): path = urllib.parse.unquote(urllib.parse.urlsplit(path)[2]) else: path = os.path.abspath(path) model = self.input_files.get_model() iter = model.append() model.set(iter, 0, path) self.update_status_bar() self.update_buttons() def on_input_files_drag_data_received(self, widget, context, x, y, data, info, time): if data.format == 8 and data.get_uris(): for uri in data.get_uris(): self.add_input_file(uri) context.finish(True, False, time) else: context.finish(False, False, time) def on_input_files_add_clicked(self, *args): fc = Gtk.FileChooserDialog( title=_("Add File..."), parent=None, action=Gtk.FileChooserAction.OPEN, buttons=(Gtk.STOCK_CANCEL,Gtk.ResponseType.CANCEL, Gtk.STOCK_ADD,Gtk.ResponseType.OK)) fc.set_select_multiple(True) fc.set_default_response(Gtk.ResponseType.OK) filter = Gtk.FileFilter() filter.set_name(_("Image Files")) filter.add_pattern('*.bmp') filter.add_pattern('*.gif') filter.add_pattern('*.jpeg') filter.add_pattern('*.jpg') filter.add_pattern('*.png') filter.add_pattern('*.tif') filter.add_pattern('*.tiff') fc.add_filter(filter) filter = Gtk.FileFilter() filter.set_name(_("All Files")) filter.add_pattern('*') fc.add_filter(filter) response = fc.run() if response == Gtk.ResponseType.OK: for uri in fc.get_filenames(): self.add_input_file(uri) fc.destroy() def on_input_files_remove_clicked(self, *args): model, rows = self.input_files.get_selection().get_selected_rows() rows = [Gtk.TreeRowReference(model, path) for path in rows] for row in rows: model.remove(model.get_iter(row.get_path())) self.update_status_bar() self.update_buttons() def get_output_suffix(self): size = self.resolution_map[ self.resolution.get_active()][0] if size: return "%dx%d" % size return "modified" def get_output_type(self): if self.output_type_append.get_active(): return 'append' if self.output_type_subdirectory.get_active(): return 'subdirectory' if self.output_type_in_place.get_active(): return 'in-place' def update_output_files(self): output_suffix = self.get_output_suffix() self.output_type_append.set_label( _("Append \"-%s\" to the file base name") % output_suffix) self.output_type_subdirectory.set_label( _("Save to \"%s\" subdirectory") % output_suffix) def update_status_bar(self): if self.task is not None: msg = _("%(current)d of %(total)d images processed") % { 'current': self.processed_count, 'total': len(self.input_files.get_model())} else: msg = _("%d images to process") % len( self.input_files.get_model()) self.statusbar.pop(0) self.statusbar.push(0, msg) def update_buttons(self): self.execute_button.set_sensitive( len(self.input_files.get_model()) > 0 and self.task is None) def execute_task(self): self.update_buttons() size = self.resolution_map[ self.resolution.get_active()][0] rotate_method = self.rotate_map[ self.rotate.get_active()][0] output_suffix = self.get_output_suffix() output_type = self.get_output_type() format, extension = self.output_format_map[ self.output_format.get_active()][0:2] errors = [] exif_to_transpose = [ (), (Image.FLIP_LEFT_RIGHT,), (Image.ROTATE_180), (Image.FLIP_TOP_BOTTOM,), (Image.ROTATE_90, Image.FLIP_LEFT_RIGHT), (Image.ROTATE_270,), (Image.ROTATE_270, Image.FLIP_LEFT_RIGHT), (Image.ROTATE_90,)] for (input,) in self.input_files.get_model(): self.update_status_bar() base, ext = os.path.splitext(input) if output_type == 'append': output = "%s-%s%s" % (base, output_suffix, extension or ext) elif output_type == 'subdirectory': dir = os.path.join(os.path.dirname(input), output_suffix) output = os.path.join(dir, os.path.basename(base) + (extension or ext)) if not os.path.exists(dir): os.makedirs(dir) else: output = base + (extension or ext) try: img = Image.open(input) except IOError: if os.access(input, os.R_OK): errors.append(_("Cannot identify image file: %s") % input) else: errors.append(_("Unable to open file: %s") % input) self.processed_count += 1 continue transpose_methods = [] if rotate_method == '90': transpose_methods = [Image.ROTATE_90] elif rotate_method == '180': transpose_methods = [Image.ROTATE_180] elif rotate_method == '270': transpose_methods = [Image.ROTATE_270] elif rotate_method == 'exif': if 'exif' in img.info: for k, val in list(img._getexif().items()): if TAGS.get(k, k) == 'Orientation': transpose_methods = exif_to_transpose[val - 1] for method in transpose_methods: img = img.transpose(method) if size: img.thumbnail(size, Image.ANTIALIAS) if format: fmt = format else: fmt = img.format options = {} if 'exif' in img.info: options['exif'] = img.info['exif'] if fmt == 'JPEG': options['quality'] = 90 try: img.save(output, fmt, **options) except IOError: errors.append(_("Unable to open file for writing: %s") % input) self.processed_count += 1 yield None self.update_status_bar() if errors: dialog = Gtk.MessageDialog(self, Gtk.DialogFlags.MODAL | Gtk.DialogFlags.DESTROY_WITH_PARENT, Gtk.MessageType.ERROR, Gtk.ButtonsType.CLOSE, "\n".join(errors)) dialog.run() if size: self.cfg.set('last_used', 'resolution', '%dx%d' % size) else: self.cfg.set('last_used', 'resolution', '') self.cfg.set('last_used', 'rotate', rotate_method or '') self.cfg.set('last_used', 'output_type', output_type) self.cfg.set('last_used', 'output_format', format or '') d = os.path.dirname(self.cfg_filename) if not os.path.exists(d): os.makedirs(d) fp = open(self.cfg_filename, 'w') self.cfg.write(fp) fp.close() def execute_iter(self): try: next(self.task) except StopIteration: self.task = None self.destroy() return False return True def execute(self, *args): if self.task is not None: return self.processed_count = 0 self.task = self.execute_task() GObject.idle_add(self.execute_iter) if __name__ == '__main__': MainWindow(sys.argv) Gtk.main() simple-image-reducer-master/simple-image-reducer.spec.in0000664000175000017500000000351113546673341023140 0ustar takakitakaki# This spec file is optimized for Fedora Name: simple-image-reducer Version: @VERSION@ Release: 1%{?dist} Summary: Reduce and rotate images in three-four clicks Group: Applications/Multimedia License: GPL URL: http://simple-image-reducer.org.ua/ Source0: http://simple-image-reducer.org.ua/download/%{name}-%{version}.tar.bz2 BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}root-%(%{__id_u} -n) BuildRequires: desktop-file-utils BuildRequires: gettext BuildRequires: intltool BuildRequires: findutils BuildRequires: python Requires: python >= 2.4 Requires: pygtk2 >= 2.12 Requires: gtk2 Requires: python-imaging Requires: python-exif %description Simple Image Reducer - is an GTK application to simple reduce and rotate images. The program can be useful for processing digital photos before sending by e-mail or uploading on the web. Image files can be supplied to the application from the file manager using the context menu "Open with...", or dragging files to the main window. %prep %setup -q %build make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT %find_lang %name %clean rm -rf $RPM_BUILD_ROOT %post update-desktop-database &> /dev/null || : touch --no-create %{_datadir}/icons/hicolor &>/dev/null || : %postun if [ $1 -eq 0 ] ; then touch --no-create %{_datadir}/icons/hicolor &>/dev/null gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : fi update-desktop-database &> /dev/null || : %posttrans gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || : %files -f %{name}.lang %defattr(-,root,root,-) %{_bindir}/simple-image-reducer %{_datadir}/applications/%{name}.desktop %{_datadir}/pixmaps/simple-image-reducer.png %{_datadir}/icons/hicolor/*/apps/simple-image-reducer.* simple-image-reducer-master/simple-image-reducer.svg0000664000175000017500000001741613546673341022411 0ustar takakitakaki image/svg+xml