-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add AppImage build * fix scrolling in reader * remove dead code
- Loading branch information
Showing
46 changed files
with
1,368 additions
and
273 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -339,4 +339,8 @@ $RECYCLE.BIN/ | |
*.msix | ||
*.msm | ||
*.msp | ||
*.lnk | ||
*.lnk | ||
|
||
# Other | ||
*.ico | ||
*.png |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import os | ||
import sys | ||
import wand.api | ||
import wand.color | ||
import wand.image | ||
|
||
def convert_image(dst: str, filepath: str, save_ico: bool = False) -> None: | ||
try: | ||
with wand.image.Image() as img: | ||
with wand.color.Color('transparent') as bgcolor: | ||
wand.api.library.MagickSetBackgroundColor(img.wand, bgcolor.resource) | ||
img.read(filename=filepath) | ||
|
||
filebase = os.path.join(dst, os.path.splitext(os.path.basename(filepath))[0]) | ||
with open(filebase + '.png', 'wb') as out: | ||
out.write(img.make_blob('png8')) | ||
if save_ico: | ||
with open(filebase + '.ico', 'wb') as out: | ||
out.write(img.make_blob('ico')) | ||
except Exception as ex: | ||
print(f'"{filepath}": {ex}') | ||
|
||
if __name__ == '__main__': | ||
if len(sys.argv) == 2: | ||
convert_image(os.path.dirname(sys.argv[1]), sys.argv[1], True) | ||
elif len(sys.argv) > 2: | ||
for file in sys.argv[2:]: | ||
convert_image(sys.argv[1], file) | ||
else: | ||
print('USAGE:\n', __file__, '<file>\n', __file__, '<destination> <files>') |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.