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

photofloat reading non-media files #34

Closed
kosli opened this issue Jul 24, 2017 · 6 comments
Closed

photofloat reading non-media files #34

kosli opened this issue Jul 24, 2017 · 6 comments

Comments

@kosli
Copy link

kosli commented Jul 24, 2017

It seems that photofloat tries now to read files that it is not supposed to "read".
so there are two things:

  • unreadable -> does that meant that it is skipping the file on purpose?
  • the gif at the end seems to have some other issue? (i'll anyways see that i remove the files from my albums folder...)
2017-07-24T12:46:11.097254   |  |  |  |  |--[Next level folder:]                           index.php_files
2017-07-24T12:46:11.097735   |  |  |  |  |  |--[ processing image/video]                      index.htm
2017-07-24T12:46:11.104400   |  |  |  |  |  |  |--[unreadable]                                   :-(
2017-07-24T12:46:11.104536   |  |  |  |  |  |--[Next level folder:]                           index_data
2017-07-24T12:46:11.106926   |  |  |  |  |  |  |--[ processing image/video]                      genericLib.js
2017-07-24T12:46:11.115294   |  |  |  |  |  |  |  |--[unreadable]                                   :-(
2017-07-24T12:46:11.115433   |  |  |  |  |  |  |--[ processing image/video]                      navigation.css
2017-07-24T12:46:11.121287   |  |  |  |  |  |  |  |--[unreadable]                                   :-(
2017-07-24T12:46:11.121404   |  |  |  |  |  |  |--[ processing image/video]                      navigationLib.js
2017-07-24T12:46:11.126207   |  |  |  |  |  |  |  |--[unreadable]                                   :-(
2017-07-24T12:46:11.126322   |  |  |  |  |  |  |--[ processing image/video]                      navigation_a.gif
Traceback (most recent call last):
  File "/var/www/download.kos.li/private/photofloat/scanner/main.py", line 164, in <module>
    main()
  File "/var/www/download.kos.li/private/photofloat/scanner/main.py", line 157, in main
    TreeWalker(Options.config['album_path'], Options.config['cache_path'])
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 28, in __init__
    folders_album = self.walk(self.album_path)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 167, in walk
    photo = Media(entry, self.cache_path)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/PhotoAlbum.py", line 184, in __init__
    self._photo_thumbnails(image, media_path, thumbs_path)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/PhotoAlbum.py", line 372, in _photo_thumbnails
    self._photo_thumbnails_cascade(image, photo_path, thumbs_path)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/PhotoAlbum.py", line 456, in _photo_thumbnails_cascade
    thumb = self._thumbnail(image_to_start_from, photo_path, thumbs_path, thumb_size)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/PhotoAlbum.py", line 555, in _thumbnail
    start_image_copy = self.resize_canvas(start_image_copy, thumb_size, Options.config['background_color'], False)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/PhotoAlbum.py", line 338, in resize_canvas
    newImage = Image.new(mode, (canvas_width, canvas_height), background_color)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1763, in new
    return Image()._new(core.fill(mode, size, color))
TypeError: an integer is required
@paolobenve
Copy link
Owner

paolobenve commented Jul 24, 2017

unreadable means that the file isn't an image nor a video. You can inspect the code that produces the info.

The TypeError at the end doesn't depend on the fact it's working with a gif: I have gif's in my album folder and they don't produce any error. Probably that specific gif has some characteristic we must study more deeply. Could you kindly attacch it? Anyway I'm going to collect some other gif in order to reproduce the issue.

Besides that, could you please use the editor code feature when pasting program output? thank you?

@paolobenve
Copy link
Owner

paolobenve commented Jul 25, 2017

@kosli, I reorganized the way little images (and gif's are always among them) are treated and showed, in development branch.

Wish you check it? Perhaps the scanner is faster then before

@kosli
Copy link
Author

kosli commented Jul 26, 2017

@paolobenve thank you very much.
i just checked with the latest revision and still have an error on a gif file:

2017-07-26T10:48:46.248542   |  |  |  |  |  |  |  |--[ processing image/video]                      01.gif
Traceback (most recent call last):
  File "/var/www/download.kos.li/private/photofloat/scanner/main.py", line 165, in <module>
    main()
  File "/var/www/download.kos.li/private/photofloat/scanner/main.py", line 158, in main
    TreeWalker(Options.config['album_path'], Options.config['cache_path'])
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 28, in __init__
    folders_album = self.walk(self.album_path)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 133, in walk
    next_walked_album = self.walk(entry)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/TreeWalker.py", line 167, in walk
    media = Media(entry, self.cache_path)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/PhotoAlbum.py", line 184, in __init__
    self._photo_thumbnails(image, media_path, thumbs_path)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/PhotoAlbum.py", line 372, in _photo_thumbnails
    self._photo_thumbnails_cascade(image, photo_path, thumbs_path)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/PhotoAlbum.py", line 456, in _photo_thumbnails_cascade
    thumb = self._thumbnail(image_to_start_from, photo_path, thumbs_path, thumb_size)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/PhotoAlbum.py", line 555, in _thumbnail
    start_image_copy = self.resize_canvas(start_image_copy, thumb_size, Options.config['background_color'], False)
  File "/var/www/clients/client3/web131/private/photofloat/scanner/PhotoAlbum.py", line 338, in resize_canvas
    newImage = Image.new(mode, (canvas_width, canvas_height), background_color)
  File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1763, in new
    return Image()._new(core.fill(mode, size, color))
TypeError: an integer is required

Please find attached the gif picture:
01

is there a way that i could exclude certain folders, e.g. an idea would be to add a file ".photofloat.exclude" or so in a folder that shouldn't be scanned by photofloat. this would make it flexible and i wouldn't need to keep a central list of folders that should be excluded, but the information is "self-included".

@paolobenve
Copy link
Owner

The problem is not the gif, it's that - unluckly - the int(round fix was lost... it's my fault, I beg your pardon

Now master should be ok, and should be able to manage little gif's

@paolobenve
Copy link
Owner

closing as I think it's fixed, feel free to reopen if needed

@kosli
Copy link
Author

kosli commented Jul 26, 2017

thanks. for the moment the scanner is still running, looks so far okay.
i'll create a new ticket for the "excluding" idea...

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