Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZeroDivisionError: float division by zero #96

Closed
Hiromi-nee opened this issue May 27, 2014 · 1 comment
Closed

ZeroDivisionError: float division by zero #96

Hiromi-nee opened this issue May 27, 2014 · 1 comment

Comments

@Hiromi-nee
Copy link

I can't seem to figure out why there's a divison by zero error.

$ sigal build -vdf seiyuu/Hikasa_Youko/
INFO: Reading settings ...
DEBUG: Settings file: sigal.conf.py
DEBUG: Rewrite source : pictures -> /var/www/seiyuu/pictures
DEBUG: Rewrite destination : _build -> /var/www/seiyuu/_build
DEBUG: Settings:
{'adjust_options': {'brightness': 1.0, 'color': 1.0, 'contrast': 1.0, 'sharpness': 1.0},
'albums_sort_reverse': False,
'autorotate_images': True,
'colorbox_column_size': 4,
'copy_exif_data': False,
'copyright': '',
'destination': u'/var/www/seiyuu/_build',
'files_to_copy': (),
'google_analytics': '',
'ignore_directories': [],
'ignore_files': [],
'img_processor': 'ResizeToFit',
'img_size': (800, 600),
'index_in_url': True,
'jpg_options': {'optimize': True, 'progressive': True, 'quality': 85},
'keep_orig': False,
'links': '',
'locale': '',
'make_thumbs': True,
'medias_sort_attr': 'filename',
'medias_sort_reverse': False,
'orig_dir': 'original',
'orig_link': False,
'source': u'/var/www/seiyuu/pictures',
'theme': 'galleria',
'thumb_dir': 'thumbnails',
'thumb_fit': True,
'thumb_prefix': '',
'thumb_size': (280, 210),
'thumb_suffix': '',
'video_size': (480, 360),
'webm_options': ['-crf', '10', '-b:v', '1.6M', '-qmin', '4', '-qmax', '63'],
'write_html': True,
'zip_gallery': False,
'zip_media_format': 'resized'}
INFO: Input : /var/www/seiyuu/seiyuu/Hikasa_Youko
INFO: Output : /var/www/seiyuu/_build
INFO: Using 1 cores
Traceback (most recent call last):
File "/usr/local/bin/sigal", line 9, in
load_entry_point('sigal==0.7.0', 'console_scripts', 'sigal')()
File "/usr/local/lib/python2.7/dist-packages/sigal/init.py", line 154, in main
parser.dispatch()
File "/usr/local/lib/python2.7/dist-packages/argh/helpers.py", line 53, in dispatch
return dispatch(self, _args, *_kwargs)
File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 124, in dispatch
for line in lines:
File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 200, in _execute_command
for line in result:
File "/usr/local/lib/python2.7/dist-packages/argh/dispatching.py", line 183, in _call
result = args.function(_positional, *_keywords)
File "/usr/local/lib/python2.7/dist-packages/sigal/init.py", line 108, in build
gal = Gallery(settings, theme=theme, ncpu=ncpu)
File "/usr/local/lib/python2.7/dist-packages/sigal/gallery.py", line 452, in init
album = Album(relpath, settings, dirs, files, self)
File "/usr/local/lib/python2.7/dist-packages/sigal/gallery.py", line 205, in init
media = Image(f, self.path, settings)
File "/usr/local/lib/python2.7/dist-packages/sigal/gallery.py", line 130, in init
self.raw_exif, self.exif = get_exif_tags(self.src_path)
File "/usr/local/lib/python2.7/dist-packages/sigal/image.py", line 251, in get_exif_tags
lat = dms_to_degrees(lat_info)
File "/usr/local/lib/python2.7/dist-packages/sigal/image.py", line 183, in dms_to_degrees
d = float(v[0][0]) / float(v[0][1])
ZeroDivisionError: float division by zero

@saimn
Copy link
Owner

saimn commented May 27, 2014

The error occurs in the conversion of gps info from exif tags: https://github.com/saimn/sigal/blob/master/sigal/image.py#L180
So you must have exif tags with 0 values in the GPSInfo field.I will add a check to avoid breaking in this case.

@saimn saimn closed this as completed in f41f7c9 May 31, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants