Repository navigation
Ignorovať macOS AppleDouble súbory (._*) pri skenovaní fotiek - #20
Merged
Merged
Conversation
SMB shares written from macOS leave "._<name>" metadata files next to real photos. These were classified as photos by extension alone, so they showed up in album/photo listings and counts, and were fed to PIL for thumbnail generation, producing "Thumbnail chyba ... cannot identify image file" warnings. HEIC watcher had the same issue with "._*.heic" files. Add photofilter.is_apple_double() as a single shared predicate and use it in webserver._iter_photo_entries, pregenerate_thumbs, and safe_photo_path (so direct /thumb, /photo, /exif, /delete URL hits are also rejected), and in watcher.scan_folder/process_file. Stale index rows are removed automatically since pregenerate_thumbs' prune() no longer sees these files as known photos.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Čo sa mení
macOS pri kopírovaní na SMB share necháva vedľa každej fotky AppleDouble súbor s metadátami – rovnaké meno s predponou
._(napr.._IMG_0137.JPG). Podľa prípony je nerozoznateľný od skutočnej fotky, takže končil v zozname albumov, v počte fotiek, v indexe aj pri generovaní thumbnailov, kde PIL zlyhal (v súbore nie je obrázok).Ako
snapframe/rootfs/usr/bin/photofilter.pys jednou funkciouis_apple_double(name)– zámerne bez závislostí, aby ho mohol importovať ajwebserver.py, ajwatcher.py.watcher.py:._*HEIC sa nekonvertuje a originál sa nemaže; vynechaný aj zoscan_folder().webserver.py: filter v_iter_photo_entries()a vpregenerate_thumbs();safe_photo_path()odmieta._*rovnako ako cesty mimo knižnice, takže ani priamy zásah na URL (/thumb,/photo,/exif, mazanie) taký súbor nevytiahne.._), nie bežné skryté súbory ako.DS_Store.Testovanie
python -m unittest discover -s tests– 115 testov OK, žiadny skip. Nové testy vtests/test_watcher.pyatests/test_webserver.pypokrývajú skenovanie, thumbnaily aj odmietnutie cezsafe_photo_path().