summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordhor <dhor@dhor-Studio-XPS-1645.(none)>2012-02-19 15:31:27 +0100
committerdhor <dhor@dhor-Studio-XPS-1645.(none)>2012-02-19 15:31:27 +0100
commitad563774c05db8c3cbd9a7c37f5ed37ece805cae (patch)
tree6f092e8a46199ad4d494eb3276ff4e7fe14ffd3c
parent41cf29a7ac5b698f19763a0692f082fb575a3f10 (diff)
downloadmacrofusion-code-ad563774c05db8c3cbd9a7c37f5ed37ece805cae.zip
macrofusion-code-ad563774c05db8c3cbd9a7c37f5ed37ece805cae.tar.gz
macrofusion-code-ad563774c05db8c3cbd9a7c37f5ed37ece805cae.tar.bz2
Up to 0.7.3
-rw-r--r--CHANGELOG6
-rw-r--r--README1
-rw-r--r--locale/ru/LC_MESSAGES/MacroFusion.mobin0 -> 8259 bytes
-rw-r--r--locale/ru/LC_MESSAGES/MacroFusion.po456
-rwxr-xr-xmacrofusion.py57
5 files changed, 502 insertions, 18 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 9c765db..cc48491 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,9 @@
+0.7.3 (19.02.2012)
+
+ * Bugfix: Proper opening/adding TIFF files
+ * pyexiv2 to read exif tags
+ * Russian translation (Alexandre Prokoudine, VictorR2007)
+
0.7.2 (24.11.2011)
* Read exif info from photos - bugfixes
diff --git a/README b/README
index 12820da..b31627b 100644
--- a/README
+++ b/README
@@ -23,6 +23,7 @@ You need:
- python (>=2.7)
- Python Imaging Library (PIL) (python-imaging)
- pygtk (python-gtk2)
+- pyexiv2 (python-pyexiv2)
- libglade (libglade2-0)
- enfuse (>=4.0)
- hugin-tools (with align_image_stack)
diff --git a/locale/ru/LC_MESSAGES/MacroFusion.mo b/locale/ru/LC_MESSAGES/MacroFusion.mo
new file mode 100644
index 0000000..cd84347
--- /dev/null
+++ b/locale/ru/LC_MESSAGES/MacroFusion.mo
Binary files differ
diff --git a/locale/ru/LC_MESSAGES/MacroFusion.po b/locale/ru/LC_MESSAGES/MacroFusion.po
new file mode 100644
index 0000000..5a93c40
--- /dev/null
+++ b/locale/ru/LC_MESSAGES/MacroFusion.po
@@ -0,0 +1,456 @@
+# SOME DESCRIPTIVE TITLE.
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# This file is distributed under the same license as the PACKAGE package.
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
+#
+msgid ""
+msgstr ""
+"Project-Id-Version: macrofusion\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2011-11-24 18:08+CET\n"
+"PO-Revision-Date: 2012-02-03 20:24+0300\n"
+"Last-Translator: Рыжих Виктор <victorr2007@yandex.ru>\n"
+"Language-Team: home\n"
+"Language: \n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Poedit-Language: Russian\n"
+"X-Poedit-Country: RUSSIAN FEDERATION\n"
+"X-Poedit-SourceCharset: utf-8\n"
+
+#: macrofusion.py:95
+msgid "Generating %s thumbnail failed."
+msgstr "Не удалось создать миниатюру для %s."
+
+#: macrofusion.py:143
+msgid ""
+"Can't find Enfuse.\n"
+"Please check enblend/enfuse is installed.\n"
+"Stopping..."
+msgstr ""
+"Не найден Enfuse.\n"
+"Пожалуйста, проверьте, установлен ли enblend/enfuse.\n"
+"Останов..."
+
+#: macrofusion.py:148
+msgid "Will use all the powers of your CPU!"
+msgstr "Будут использоваться все возможности вашего процессора!"
+
+#: macrofusion.py:166
+msgid "CPU Cores: %s"
+msgstr "Ядер ЦП: %s"
+
+#: macrofusion.py:271
+msgid ""
+"Exiftool is missing!\n"
+"\n"
+" Cannot copy exif info."
+msgstr ""
+"Exiftool отсутствует!\n"
+"\n"
+" Не удается скопировать информацию EXIF."
+
+#: macrofusion.py:278
+msgid ""
+"Hugin tools (align_image_stack) are missing !\n"
+"\n"
+" Cannot auto align images."
+msgstr ""
+"Инструменты Hugin (align_image_stack) отсутствуют!\n"
+"\n"
+" Невозможно автоматический выровнять изображения."
+
+#: macrofusion.py:356
+msgid ""
+".\n"
+"\n"
+" Revert to default value."
+msgstr ""
+".\n"
+"\n"
+" Вернитесь к значению по умолчанию."
+
+#: macrofusion.py:356
+msgid ""
+"No such application!\n"
+"\n"
+" Cannot find "
+msgstr ""
+"Нет такого приложения!\n"
+"\n"
+" Не удается найти "
+
+#: macrofusion.py:379
+msgid "Image"
+msgstr "Изображение"
+
+#: macrofusion.py:385
+msgid "Thumbnail"
+msgstr "Миниатюра"
+
+#: macrofusion.py:439
+#: macrofusion.py:578
+msgid ""
+"Please add or activate at least two images.\n"
+"\n"
+" Cannot do anything smart with the one or no image."
+msgstr ""
+"Пожалуйста, добавьте или активируйте по крайней мере два изображения.\n"
+"\n"
+" Невозможно сделать что-то умное с одним изображением или без него."
+
+#: macrofusion.py:502
+msgid "Calculating preview..."
+msgstr "Создается предпросмотр"
+
+#: macrofusion.py:507
+msgid "Preview generated"
+msgstr "Предпросмотр создан"
+
+#: macrofusion.py:533
+msgid ""
+"No preview, no output, no edit.\n"
+"\n"
+" Game Over."
+msgstr ""
+"Нет предпросмотра, нет вывода, нет редактирования.\n"
+"\n"
+" Конец Игры."
+
+#: macrofusion.py:553
+msgid "<b>Model:</b> "
+msgstr "<b>Модель:</b> "
+
+#: macrofusion.py:554
+msgid "<b>Date:</b> "
+msgstr "<b>Дата:</b> "
+
+#: macrofusion.py:555
+msgid "<b>Focal length:</b> "
+msgstr "<b>Фокусное расстояние:</b> "
+
+#: macrofusion.py:556
+msgid "<b>Aperture:</b> F/"
+msgstr "<b>Относительное отверстие:</b> F/"
+
+#: macrofusion.py:557
+msgid "<b>Exposure Time:</b> "
+msgstr "<b>Время выдержки:</b> "
+
+#: macrofusion.py:575
+msgid ""
+"Can't overwrite input image!\n"
+"\n"
+" Please change the output filename."
+msgstr ""
+"Невозможно перезаписать исходное изображение!\n"
+"\n"
+"Пожалуйста, измените имя выходного файла."
+
+#: macrofusion.py:630
+msgid "<b>Filename:</b> "
+msgstr "<b>Имя файла:</b> "
+
+#: macrofusion.py:630
+msgid "<b>Resolution:</b> "
+msgstr "<b>Разрешение:</b> "
+
+#: macrofusion.py:635
+msgid ""
+"Only JPEG and TIFF files are allowed.\n"
+"\n"
+"Cannot open:\n"
+msgstr ""
+"Разрешены только JPEG and TIFF файлы.\n"
+"\n"
+"Невозможно открыть:\n"
+
+#: macrofusion.py:654
+msgid "Add images..."
+msgstr "Добавить изображения..."
+
+#: macrofusion.py:666
+msgid "Open images..."
+msgstr "Открыть изображения..."
+
+#: macrofusion.py:717
+msgid "Save file..."
+msgstr "Сохранить файл..."
+
+#: macrofusion.py:762
+msgid ""
+"Please add two or more images.\n"
+"\n"
+" Cannot do anything smart with the one image."
+msgstr ""
+"Пожалуйста, добавьте два или более изображений.\n"
+"\n"
+"Невозможно сделать что-то умное с одним изображением."
+
+#: macrofusion.py:774
+msgid ":: Align photos..."
+msgstr ":: Выравнивание снимков..."
+
+#: macrofusion.py:780
+msgid ":: Fusion photos..."
+msgstr "::Сведение снимков..."
+
+#: macrofusion.py:803
+msgid "Fusion images..."
+msgstr "Сведение изображений..."
+
+#: macrofusion.py:811
+msgid "Fusion, please wait..."
+msgstr "Сведение, подождите пожалуйста..."
+
+#: macrofusion.py:816
+msgid "Fused !"
+msgstr "Соединен !"
+
+#: ui/DOFuseInterface2.glade:22
+msgid "_File"
+msgstr "Файл"
+
+#: ui/DOFuseInterface2.glade:65
+msgid "Remove All"
+msgstr "Удалить все"
+
+#: ui/DOFuseInterface2.glade:119
+msgid "H_elp"
+msgstr "Справка"
+
+#: ui/DOFuseInterface2.glade:209
+msgid "Exposure (default: 1)"
+msgstr "Экспозиция (по умолчанию: 1)"
+
+#: ui/DOFuseInterface2.glade:270
+msgid "Contrast (default: 0)"
+msgstr "Контраст (по умолчанию: 0)"
+
+#: ui/DOFuseInterface2.glade:330
+msgid "Saturation (default: 0.2)"
+msgstr "Насыщенность (по умолчанию: 0.2)"
+
+#: ui/DOFuseInterface2.glade:390
+msgid "Mean exposure (default: 0.5)"
+msgstr "Средняя экспозиция (по умолчанию: 0.5)"
+
+#: ui/DOFuseInterface2.glade:450
+msgid "Deviation (default: 0.2)"
+msgstr "Отклонение (по умолчанию: 0.2)"
+
+#: ui/DOFuseInterface2.glade:513
+msgid "<b>Fusion parameters</b>"
+msgstr "<b>Параметры сведения</b>"
+
+#: ui/DOFuseInterface2.glade:543
+msgid "Align"
+msgstr "Выровнять"
+
+#: ui/DOFuseInterface2.glade:561
+msgid "Autocrop"
+msgstr "Автоматически кадрировать"
+
+#: ui/DOFuseInterface2.glade:579
+msgid "Optimize image center shift"
+msgstr "Оптимизировать сномок сдвигом центра"
+
+#: ui/DOFuseInterface2.glade:598
+msgid "Optimize field of view"
+msgstr "Оптимизировать поле обзора"
+
+#: ui/DOFuseInterface2.glade:623
+msgid "<b>Align images</b>"
+msgstr "<b>Выравнивание снимков</b>"
+
+#: ui/DOFuseInterface2.glade:643
+msgid "Fusion"
+msgstr "Сведение"
+
+#: ui/DOFuseInterface2.glade:670
+msgid "Pyramid levels: "
+msgstr "Уровни пирамиды:"
+
+#: ui/DOFuseInterface2.glade:726
+msgid "Force HardMask "
+msgstr "Жёсткая маска "
+
+#: ui/DOFuseInterface2.glade:764
+msgid "Contrast window:"
+msgstr "Окно контраста:"
+
+#: ui/DOFuseInterface2.glade:827
+msgid "Min Curvature:"
+msgstr "Минимальная кривизна:"
+
+#: ui/DOFuseInterface2.glade:844
+msgid "%"
+msgstr "%"
+
+#: ui/DOFuseInterface2.glade:902
+msgid "EdgeScale:"
+msgstr "Масштаб края:"
+
+#: ui/DOFuseInterface2.glade:960
+msgid "EdgeScale"
+msgstr "Масштаб края"
+
+#: ui/DOFuseInterface2.glade:1035
+msgid "LceScale"
+msgstr ""
+
+#: ui/DOFuseInterface2.glade:1106
+msgid "LceFactor"
+msgstr ""
+
+#: ui/DOFuseInterface2.glade:1142
+msgid "Use CIECAM02 color profile"
+msgstr "Использовать цветовой профиль CIECAM02"
+
+#: ui/DOFuseInterface2.glade:1191
+msgid ""
+"Mean\n"
+"L-star\n"
+"Lightness\n"
+"Value\n"
+"Luminance"
+msgstr ""
+"Середина\n"
+"L-star\n"
+"Светлота\n"
+"Насыщенность\n"
+"Яркость"
+
+#: ui/DOFuseInterface2.glade:1207
+msgid "Gray projector:"
+msgstr "Проектор серого:"
+
+#: ui/DOFuseInterface2.glade:1244
+msgid "<b>Expert Options</b>"
+msgstr "<b>Опции эксперта</b>"
+
+#: ui/DOFuseInterface2.glade:1260
+msgid "Expert"
+msgstr "Эксперт"
+
+#: ui/DOFuseInterface2.glade:1294
+msgid "Preview size:"
+msgstr "Размер предосмотра:"
+
+#: ui/DOFuseInterface2.glade:1316
+#: ui/DOFuseInterface2.glade:1359
+msgid "The larger resolution - the longer it takes to generate preview."
+msgstr "Чем больше разрешение - тем больше времени требуется для подготовки предпросмотра."
+
+#: ui/DOFuseInterface2.glade:1335
+#: ui/DOFuseInterface2.glade:1632
+msgid "Width"
+msgstr "Ширина"
+
+#: ui/DOFuseInterface2.glade:1378
+#: ui/DOFuseInterface2.glade:1673
+msgid "Height"
+msgstr "Высота"
+
+#: ui/DOFuseInterface2.glade:1425
+msgid "Cache Size:"
+msgstr "Размер кеша:"
+
+#: ui/DOFuseInterface2.glade:1439
+msgid "1024 Mb (default)"
+msgstr "1024 МиБ (по умолчанию)"
+
+#: ui/DOFuseInterface2.glade:1495
+msgid "Bloc Size: "
+msgstr "Размер блока:"
+
+#: ui/DOFuseInterface2.glade:1509
+msgid "2048 kb (default)"
+msgstr "2048 КиБ (по умолчанию)"
+
+#: ui/DOFuseInterface2.glade:1569
+msgid "Final image size:"
+msgstr "Конечный размер:"
+
+#: ui/DOFuseInterface2.glade:1579
+#: ui/DOFuseInterface2.glade:1807
+msgid "Default"
+msgstr "По умолчанию"
+
+#: ui/DOFuseInterface2.glade:1714
+msgid "X-offset"
+msgstr "Смещение X"
+
+#: ui/DOFuseInterface2.glade:1755
+msgid "Y-offset"
+msgstr "Смещение Y"
+
+#: ui/DOFuseInterface2.glade:1793
+msgid "Jpeg compression:"
+msgstr "Сжатие JPEG:"
+
+#: ui/DOFuseInterface2.glade:1861
+msgid "Tiff compression: "
+msgstr "Сжатие TIFF:"
+
+#: ui/DOFuseInterface2.glade:1874
+msgid ""
+"None\n"
+"Packbits\n"
+"LZW\n"
+"Deflate"
+msgstr ""
+"Нет\n"
+"Packbits\n"
+"LZW\n"
+"Deflate"
+
+#: ui/DOFuseInterface2.glade:1912
+msgid "Edit with: "
+msgstr "Редактировать в: "
+
+#: ui/DOFuseInterface2.glade:1973
+msgid "<b>Software Options</b>"
+msgstr "<b>Опции программы</b>"
+
+#: ui/DOFuseInterface2.glade:1999
+msgid "Copy exif info ?"
+msgstr "Копировать данные EXIF?"
+
+#: ui/DOFuseInterface2.glade:2013
+msgid "<b>Exif</b>"
+msgstr "<b>EXIF</b>"
+
+#: ui/DOFuseInterface2.glade:2036
+msgid "Configuration"
+msgstr "Конфигурация"
+
+#: ui/DOFuseInterface2.glade:2068
+msgid "_Before/After"
+msgstr "До/После"
+
+#: ui/DOFuseInterface2.glade:2086
+msgid "_Preview"
+msgstr "_Предосмотр"
+
+#: ui/DOFuseInterface2.glade:2160
+msgid "<b>Photos</b>"
+msgstr "<b>Снимки</b>"
+
+#: ui/DOFuseInterface2.glade:2243
+msgid "<b>Action</b>"
+msgstr "<b>Действие</b>"
+
+#: ui/DOFuseInterface2.glade:2301
+msgid "<b>Preview</b>"
+msgstr "<b>Предосмотр</b>"
+
+#: ui/Progress.glade:20
+msgid "label"
+msgstr "Метка"
+
+#: ui/Progress.glade:50
+msgid "Close"
+msgstr "Закрыть"
+
diff --git a/macrofusion.py b/macrofusion.py
index be59564..e555edd 100755
--- a/macrofusion.py
+++ b/macrofusion.py
@@ -18,6 +18,7 @@ try:
import operator
import cairo
import random
+ import pyexiv2
except:
print('An error occured. Python or one of its sub modules is absent...\nIt would be wise to check your python installation.')
sys.exit(1)
@@ -44,7 +45,7 @@ global session_options_bak
session_options_bak=[]
APP = 'MacroFusion'
-__VERSION__='0.7.2'
+__VERSION__='0.7.3'
__LICENSE__='GPL'
__COPYRIGHT__='Dariusz Duma'
__WEBSITE__='http://sourceforge.net/p/macrofusion'
@@ -90,9 +91,13 @@ def toggled_cb(cell, path, user_data):
def creer_miniature(chemin,taille):
outfile=donnees.previs_dossier + '/' + os.path.split(chemin)[1]
try:
- im = Image.open(chemin)
- im.thumbnail(taille)
- im.save(outfile, "JPEG")
+ im = gtk.gdk.pixbuf_new_from_file_at_size(chemin, taille[0], taille[1])
+# pb = gtk.gdk.pixbuf_new_from_file(chemin)
+# im = Interface.pixbuf2Image(Interface(),pb)
+# im = Image.open(chemin)
+# im.thumbnail(taille)
+# im.save(outfile, "JPEG")
+ im.save(outfile, "jpeg", {"quality":"98"})
except IOError:
print _("Generating %s thumbnail failed.") % chemin
return outfile
@@ -545,18 +550,28 @@ class Interface:
tags={}
exifinfo=None
try:
- im = Image.open(fichier)
- if hasattr( im, '_getexif' ):
- exifinfo = im._getexif()
- if exifinfo != None:
- for tag, value in exifinfo.items():
- decoded = TAGS.get(tag, tag)
- tags[decoded] = value
- if tags.get('Model'): tags2=(_("<b>Model:</b> ") + str(tags['Model']) + "\n")
- if tags.get('DateTimeOriginal'): tags2+=(_("<b>Date:</b> ") + str(tags['DateTimeOriginal']) + "\n")
- if tags.get('FocalLength'): tags2+=(_("<b>Focal length:</b> ") + str(int(int(tags['FocalLength'][0])/int(tags['FocalLength'][1]))) + "mm \n")
- if tags.get('FNumber'): tags2+=(_("<b>Aperture:</b> F/") + str(float(float(tags['FNumber'][0])/float(tags['FNumber'][1]))) + "\n")
- if tags.get('ExposureTime'): tags2+=(_("<b>Exposure Time:</b> ") + str(str(tags['ExposureTime'][0]/10) + "/" + str(tags['ExposureTime'][1]/10) + " s. \n"))
+ # im = Image.open(fichier)
+ im = pyexiv2.ImageMetadata(fichier)
+ im.read()
+
+# if hasattr( im, '_getexif' ):
+# exifinfo = im._getexif()
+# if exifinfo != None:
+# for tag, value in exifinfo.items():
+# decoded = TAGS.get(tag, tag)
+# tags[decoded] = value
+ tags_keys = im.exif_keys
+ if tags_keys != '':
+ if 'Exif.Image.Model' in tags_keys:
+ tags2=(_("<b>Model:</b> ") + str(im['Exif.Image.Model'].value) + "\n")
+ if 'Exif.Image.DateTimeOriginal' in tags_keys:
+ tags2+=(_("<b>Date:</b> ") + str(im['Exif.Image.DateTimeOriginal'].value) + "\n")
+ if 'Exif.Photo.FocalLength' in tags_keys:
+ tags2+=(_("<b>Focal length:</b> ") + str(int(im['Exif.Photo.FocalLength'].value)) + "mm \n")
+ if 'Exif.Photo.FNumber' in tags_keys:
+ tags2+=(_("<b>Aperture:</b> F/") + str(im['Exif.Photo.FNumber'].value) + "\n")
+ if 'Exif.Photo.ExposureTime' in tags_keys:
+ tags2+=(_("<b>Exposure Time:</b> ") + str(im['Exif.Photo.ExposureTime'].value) + " s. \n")
except IOError:
print "failed to identify", file
return tags2
@@ -616,7 +631,11 @@ class Interface:
# gtk.accel_map_save(self.config_dir + '/accel_map')
return
-
+
+ def pixbuf2Image(self, pb):
+ width,height = pb.get_width(),pb.get_height()
+ return Image.fromstring("RGB",(width,height),pb.get_pixels() )
+
def put_files_to_the_list(self, fichiers):
self.fichiers=fichiers
@@ -624,7 +643,9 @@ class Interface:
self.badfiles=[]
for fichier in self.fichiers:
if re.search('\\.jpg$|\\.jpeg$|\\.tiff$|\\.tif$', fichier, flags=re.IGNORECASE):
- im = Image.open(fichier)
+ pb = gtk.gdk.pixbuf_new_from_file(fichier)
+ im = self.pixbuf2Image(pb)
+# im.save("welldone.jpg", "JPEG",quality=80)
self.size=im.size
self.tags2 = Gui.get_exif(fichier)
if not self.tags2: