Metadata should be updated after a save.
Bug #385059 reported by
Stani
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Phatch |
Fix Released
|
Medium
|
Stani |
Bug Description
After each save action.
Changed in phatch: | |
assignee: | nobody → stani (stani) |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in phatch: | |
milestone: | none → 0.2.1 |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
$ bzr diff core/lib/ _pyexiv2. py' core/lib/ _pyexiv2. py 2009-06-09 14:46:38 +0000 core/lib/ _pyexiv2. py 2009-06-09 16:08:42 +0000 splitext( path)[- 1] splitext( path)[- 1] WRITE_IPTC) ):
=== modified file 'phatch/
--- phatch/
+++ phatch/
@@ -141,9 +141,14 @@
if not metadata:
return ''
#better try to figure out format by extension if it unknown
- ext = os.path.
- if ext:
- format = ext.upper()
+ if not format:
+ ext = os.path.
+ if ext:
+ format = ext[1:].upper()
+ if format in ['JPG','JPE']:
+ format = 'JPEG'
+ elif format == 'TIF':
+ format = 'TIFF'
if (format and not(format in WRITE_EXIF+
raise Exception('pyexiv2: writing metadata to %s is not supported'%format)
image = pyexiv2.Image(path)
=== modified file 'phatch/ core/pil. py'
info[ 'Pil.Format' ] = format info_metadata( info,location, image) info_metadata( info,location, image=None) :
extract_ info_pexif( info,image) info_pyexiv2( info,location) info_EXIF( info,location) info_pyexiv2( info,location) info_EXIF( info,location)
--- phatch/core/pil.py 2009-06-09 14:46:38 +0000
+++ phatch/core/pil.py 2009-06-09 16:09:15 +0000
@@ -293,10 +293,14 @@
if format:
if metadata:
+ extract_
+ return info
+
+def extract_
+ if image:
- extract_
- extract_
- return info
+ extract_
+ extract_
def get_exif_ transposition( image): orientation( image) NEEDS_PYEXIV2) self.info[ 'path'] ,self.metadata, location, self.metadata,
self. info['Pil. Format' ])
self. metadata = {} location) info_metadata( self.info, location, image)
orientation = get_exif_
@@ -434,10 +438,17 @@
#throw an error if pyexiv2 is not installed
if not exif:
raise ImportError(
- self.log += exif.flush(
+ location = self.info['path']
+ self.log += exif.flush(
#as metadata has changed, use new source
+ #update
+ try:
+ image = Image.open(
+ except:
+ image = None
+ extract_
def get_filename( self,folder, filename, typ):
self. info[_t( 'new')+ DOT+_t( 'width' )], \
$ bzr commit -m "fix update metadata" sync/python/ phatch/ trunk/ core/lib/ _pyexiv2. py
Committing to: /home/stani/
modified phatch/core/pil.py
modified phatch/
Committed revision 713.