glue icon indicating copy to clipboard operation
glue copied to clipboard

Bug using new ordering "filename"

Open davidlemaitre opened this issue 11 years ago • 5 comments

I've just updated Glue to 0.9.2 and try the new ordering 'filename' but it's not working, see traceback below :

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/glue/bin.py", line 235, in main manager.process() File "/usr/local/lib/python2.7/dist-packages/glue/managers/base.py", line 14, in process self.find_sprites() File "/usr/local/lib/python2.7/dist-packages/glue/managers/simple.py", line 12, in find_sprites self.add_sprite(path=self.config['source']) File "/usr/local/lib/python2.7/dist-packages/glue/managers/base.py", line 25, in add_sprite sprite = Sprite(path=path, config=self.config) File "/usr/local/lib/python2.7/dist-packages/glue/core.py", line 199, in init self.process() File "/usr/local/lib/python2.7/dist-packages/glue/core.py", line 204, in process algorithm.process(self) File "/usr/local/lib/python2.7/dist-packages/glue/algorithms/square.py", line 138, in process image.x = node.x AttributeError: 'NoneType' object has no attribute 'x' ================================================================================ Use --force to continue.

davidlemaitre avatar Feb 23 '14 20:02 davidlemaitre

There is any way I can see the full error output from glue? I think... it should output things like your OS, Python version... options you are using... etc...

jorgebastida avatar Feb 23 '14 20:02 jorgebastida

This is the full error output :

Version: 0.9.2 Python: 2.7.5+ (default, Sep 19 2013, 13:48:49) [GCC 4.8.1] PIL version: 1.1.7 Platform: Linux-3.11.0-17-generic-x86_64-with-Ubuntu-13.10-saucy Config: {'css_dir': '/var/www/XXX/fileadmin/templates/XXX/img/sprites', 'less_dir': '/var/www/XXX/fileadmin/templates/XXX/less/sprites', 'force': True, 'json_dir': False, 'crop': True, 'generate_css': True, 'css_url': u'/fileadmin/templates/XXX/img/sprites/', 'global_template': None, 'css_namespace': u'sprite', 'html_dir': False, 'css_cachebuster': False, 'recursive': True, 'css_separator': u'-', 'css_pseudo_class_separator': u'__', 'enabled_formats': ['img', 'less', 'css'], 'source': '/var/www/XXX/fileadmin/templates/XXX/img/unsprited/map', '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': u'/var/www/XXX/fileadmin/templates/XXX/img/sprites', 'png8': False, 'quiet': False, 'project': False, 'algorithm_ordering': u'filename', 'debug': False, 'output': None, 'margin': u'0', 'css_template': None, 'ignore_filename_paddings': False} Args: ['/usr/local/bin/glue', '--css=fileadmin/templates/XXX/img/sprites', '--img=fileadmin/templates/XXX/img/sprites', '--recursive', '--crop', '--force', '--less=fileadmin/templates/XXX/less/sprites', '--url=/fileadmin/templates/XXX/img/sprites/', '--ordering=filename', 'fileadmin/templates/XXX/img/unsprited/map']

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/glue/bin.py", line 235, in main manager.process() File "/usr/local/lib/python2.7/dist-packages/glue/managers/base.py", line 14, in process self.find_sprites() File "/usr/local/lib/python2.7/dist-packages/glue/managers/simple.py", line 12, in find_sprites self.add_sprite(path=self.config['source']) File "/usr/local/lib/python2.7/dist-packages/glue/managers/base.py", line 25, in add_sprite sprite = Sprite(path=path, config=self.config) File "/usr/local/lib/python2.7/dist-packages/glue/core.py", line 199, in init self.process() File "/usr/local/lib/python2.7/dist-packages/glue/core.py", line 204, in process algorithm.process(self) File "/usr/local/lib/python2.7/dist-packages/glue/algorithms/square.py", line 138, in process image.x = node.x AttributeError: 'NoneType' object has no attribute 'x' ================================================================================ Use --force to continue.

davidlemaitre avatar Feb 23 '14 21:02 davidlemaitre

I really think this issue is not related with the filename ordering. I would say... it is because some kind of glitch with the Square algorithm. There is any way you can share here you source images? If you can't make them public here, would you mind sharing them with me privately? ([email protected])

jorgebastida avatar Feb 23 '14 22:02 jorgebastida

I confirm it works if I use horizontal, vertical or diagonal algorithm. I can imagine the complexity to make square sprites with the filename ordering. Maybe just add a warning in the Glue documentation about filename not compatible with square algorithm.

davidlemaitre avatar Feb 23 '14 22:02 davidlemaitre

Um... it is not more complex at all. Before allocating the images within the sprite, glue order them using one of the ordering options. Afterwards (using the ordered list of images) it adds them to the sprite sequentially. I really need some information about the input (number of images, sizes and filenames) A zip file would be ideal.

jorgebastida avatar Feb 23 '14 22:02 jorgebastida