Repository: getnikola/nikola

Issue:
scale_images has unusal ignoring setup
```py
         ignore = set(['.svn'])
```

WTF, svn? This is 2016. Also, why is this a set?

```py
                 if src_name in ('.DS_Store', 'Thumbs.db'):
```

Should probably be merged with dictionary ignores. (Not sure if we need to make this customizable?)


Discussion:
Just a thought: relying on the letter case of `Thumbs.db` might not be such a good idea, either, as Windows is case insensitive by default and I'm almost sure I've already seen instances of that file named `thumbs.db`.
Anyway it does nothing, since noone wil ever have .db as an "image
extension" ... right?

On Wed, Nov 23, 2016 at 4:33 PM Niels Böhm notifications@github.com wrote:

> Just a thought: relying on the letter case of Thumbs.db might not be such
> a good idea, either, as Windows is case insensitive by default and I'm
> almost sure I've already seen instances of that file named thumbs.db.
> 
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> https://github.com/getnikola/nikola/issues/2566#issuecomment-262610506,
> or mute the thread
> https://github.com/notifications/unsubscribe-auth/AAAGKzLyDpO3Dlg72OV7ZvsZdjpUvNG-ks5rBJT6gaJpZM4K69X0
> .

And for .DS_Store ... isn't that usually a directory?
No, it’s a file.
Ok then, but, once more, not something that is going to be considered an image, so it's skipped anyway.
So, nuke both ignores? Does svn really put its folders in every directory of a repo?
I believe there were different versions of svn where either the older or the newer one put `.svn` into every subdirectory and the other one just into the repository root, but don't quote me on that.
if SVN does put the .svn everywhere, *and* it creates things called ".jpg" or whatever inside the .svn then maybe we have to hold our noses and keep it. The other one, I say kill it.
Older versions of Subversion did that, newer ones don't. The behavior changed in version 1.7 (http://subversion.apache.org/docs/release-notes/1.7.html#wc-ng).
I'm not sure anymore (and can't find anything quickly), but it could have been that in Subversion 1.6.x and earlier, the `.svn` folder contains files with the same name as in the folder containing `.svn`, i.e. that could include `.jpeg` files. (It could also have been that some extension was added. I'm not sure anymore.)

Resolving patch:
diff --git a/nikola/plugins/task/scale_images.py b/nikola/plugins/task/scale_images.py
--- a/nikola/plugins/task/scale_images.py
+++ b/nikola/plugins/task/scale_images.py
@@ -46,17 +46,12 @@ def set_site(self, site):
     def process_tree(self, src, dst):
         """Process all images in a src tree and put the (possibly) rescaled images in the dst folder."""
         thumb_fmt = self.kw['image_thumbnail_format']
-        ignore = set(['.svn'])
         base_len = len(src.split(os.sep))
         for root, dirs, files in os.walk(src, followlinks=True):
             root_parts = root.split(os.sep)
-            if set(root_parts) & ignore:
-                continue
             dst_dir = os.path.join(dst, *root_parts[base_len:])
             utils.makedirs(dst_dir)
             for src_name in files:
-                if src_name in ('.DS_Store', 'Thumbs.db'):
-                    continue
                 if (not src_name.lower().endswith(tuple(self.image_ext_list)) and not src_name.upper().endswith(tuple(self.image_ext_list))):
                     continue
                 dst_file = os.path.join(dst_dir, src_name)


Test patch: