wallpapers: don't thumbnail if already exists
Have to clear cache if you change a wallpaper's contents but not name Fixes small freeze on startup
This commit is contained in:
parent
7ccde9495f
commit
93f1dd5131
1 changed files with 2 additions and 1 deletions
|
|
@ -40,7 +40,8 @@ export default class Wallpapers extends GObject.Object {
|
||||||
async #thumbnail(path: string) {
|
async #thumbnail(path: string) {
|
||||||
const dir = path.slice(1, path.lastIndexOf("/")).replaceAll("/", "-");
|
const dir = path.slice(1, path.lastIndexOf("/")).replaceAll("/", "-");
|
||||||
const thumbPath = `${this.#thumbnailDir}/${dir}-${basename(path)}.jpg`;
|
const thumbPath = `${this.#thumbnailDir}/${dir}-${basename(path)}.jpg`;
|
||||||
await execAsync(`magick -define jpeg:size=1000x500 ${path} -thumbnail 500x250 -unsharp 0x.5 ${thumbPath}`);
|
if (!GLib.file_test(thumbPath, GLib.FileTest.EXISTS))
|
||||||
|
await execAsync(`magick -define jpeg:size=1000x500 ${path} -thumbnail 500x250 -unsharp 0x.5 ${thumbPath}`);
|
||||||
return thumbPath;
|
return thumbPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue