-
Notifications
You must be signed in to change notification settings - Fork 31
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
feat: storing thumbnails on disk #201
base: master
Are you sure you want to change the base?
Conversation
e142daa
to
f51c6e5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this feature should be optional. We need an option in the config file that will allow saving thumbnails to disk. Writing anything to persistent storage by default is not a good idea.
src/pixmap.c
Outdated
return false; | ||
} | ||
|
||
// TODO: add alpha channel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have 14 supported image formats. It would be better to use one of them instead of reinventing own format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see any function for writing an image to disk in the codebase. Did I miss something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current code doesn't contain code for encoders. But these APIs are available to swayimg
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it fine to keep current ppm format or should I change it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to add encode_pnm
to PNM(PPM) decoder.
8f74942
to
25fa0e2
Compare
a174ef2
to
ad5f58f
Compare
Please, rebase to latest master. This will fix Ubuntu CI (but this doesn't resolve the warnings you have =). |
d39131f
to
f3ad6a7
Compare
return true; | ||
} | ||
|
||
static bool get_thumb_path(char** path, const char* source) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static chat* get_thumb_path(const char* source)
would be clearer.
Bu the way, source can contain prefix exec://
or starts with ../../../../../../etc/passwd
, so which path you finally create?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this is a problem. I will fix it to not pass source, but the absolute file path.
struct thumbnail_params params; | ||
|
||
/* TODO: move to config */ | ||
bool thumbnails_disk_cache = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be a part of the static context for the thumbnail entity.
2ef0a74
to
88f2d10
Compare
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
refactor: format code Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
breaking change: image_thumbnail() takes arguments Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Signed-off-by: Rentib <[email protected]>
Closes #200