jorgebastida / glue

Glue is a simple command line tool to generate CSS sprites
http://glue.readthedocs.org
BSD 3-Clause "New" or "Revised" License
2.55k stars 170 forks source link

Ordering by filename bug #169

Open Jarco opened 10 years ago

Jarco commented 10 years ago

I have found a bug while trying to create a sprite. Images:

a1 a2 a3 a4 a5 a6

complete output here:

[jarco@geronimo files]$ glue sprite sprites --ordering=filename
    a1.png added to sprite
    a2.png added to sprite
    a3.png added to sprite
    a4.png added to sprite
    a5.png added to sprite
    a6.png added to sprite
Processing 'sprite':

================================================================================
You've found a bug! Please, raise an issue attaching the following traceback
https://github.com/jorgebastida/glue/issues/new
--------------------------------------------------------------------------------
Version: 0.9.4
Python: 2.7.8 (default, Jul  1 2014, 17:30:21) 
[GCC 4.9.0 20140604 (prerelease)]
PIL version: 1.1.7
Platform: Linux-3.13.11.5-1-MANJARO-x86_64-with-glibc2.2.5
Config: {'css_dir': '/home/jarco/VirtualBox VMs/share/symobo/files/sprites', 'less_dir': False, 'force': False, 'json_dir': False, 'crop': False, 'less_template': None, 'css_url': u'', 'global_template': None, 'css_namespace': u'sprite', 'html_dir': False, 'css_cachebuster': False, 'recursive': False, 'scss_template': None, 'css_pseudo_class_separator': u'__', 'enabled_formats': ['img', 'css'], 'generate_css': True, 'source': '/home/jarco/VirtualBox VMs/share/symobo/files/sprite', 'optipng': False, 'follow_links': False, 'imagemagick': False, 'each_template': None, 'json_format': u'array', 'watch': False, 'css_sprite_namespace': u'{sprite_name}', 'padding': u'0', 'ratio_template': None, 'ratios': u'1', 'caat_dir': False, 'optipngpath': None, 'css_cachebuster_only_sprites': False, 'scss_dir': False, 'generate_image': True, 'cocos2d_dir': False, 'imagemagickpath': None, 'algorithm': u'square', 'css_cachebuster_filename': False, 'img_dir': '/home/jarco/VirtualBox VMs/share/symobo/files/sprites', 'png8': False, 'quiet': False, 'project': False, 'css_separator': u'-', 'algorithm_ordering': u'filename', 'debug': False, 'output': '/home/jarco/VirtualBox VMs/share/symobo/files/sprites', 'margin': u'0', 'css_template': None, 'ignore_filename_paddings': False}
Args: ['/usr/bin/glue', 'sprite', 'sprites', '--ordering=filename']

Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/glue/bin.py", line 235, in main
    manager.process()
  File "/usr/lib/python2.7/site-packages/glue/managers/base.py", line 12, in process
    self.find_sprites()
  File "/usr/lib/python2.7/site-packages/glue/managers/simple.py", line 12, in find_sprites
    self.add_sprite(path=self.config['source'])
  File "/usr/lib/python2.7/site-packages/glue/managers/base.py", line 23, in add_sprite
    sprite = Sprite(path=path, config=self.config)
  File "/usr/lib/python2.7/site-packages/glue/core.py", line 198, in __init__
    self.process()
  File "/usr/lib/python2.7/site-packages/glue/core.py", line 203, in process
    algorithm.process(self)
  File "/usr/lib/python2.7/site-packages/glue/algorithms/square.py", line 138, in process
    image.x = node.x
AttributeError: 'NoneType' object has no attribute 'x'
================================================================================
Jarco commented 10 years ago

This does work when I change the algoritm with the "-a" argument