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

Empty files (0kb) should be ignored #4849

Open
StefanOltmann opened this issue Jan 24, 2025 · 0 comments
Open

Empty files (0kb) should be ignored #4849

StefanOltmann opened this issue Jan 24, 2025 · 0 comments

Comments

@StefanOltmann
Copy link

Description

It is possible to upload empty (0KB) files either directly or through "watched folders".

Empty files may occur if another application corrupts the files during processing.

To handle these situations, it’s best to skip empty files entirely. Currently, Ente attempts to import such files but cannot generate thumbnails for them.

This behavior can be reproduced easily by creating a new empty text file and renaming it to empty.jpg.

To prevent similar issues, I recommend validating files by checking their magic bytes (see Wikipedia: List of file signatures) before uploading. This helps ensure that files with incorrect extensions don’t enter your system.

For instance, it’s possible to rename any file to photo.jpg and upload it, even if the file isn’t a valid photo (like a ZIP or EXE).

Version

v1.7.8

What product are you using?

Ente Photos

What platform are you using?

Desktop - Windows

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

1 participant