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

feat: Add thumbnail extraction for ePub files #387

Closed
wants to merge 92 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
e5a0e5a
Drag and drop files in and out of TagStudio (#153)
Creepler13 Jun 13, 2024
888b674
fix: backslashes in f-string error on file drop dupe widget (#289)
Technoguyfication Jun 14, 2024
6862f89
Merge branch 'main' into Alpha-v9.4
CyanVoxel Jul 3, 2024
883354b
Blender thumbnail support (#273)
050011-code Jul 3, 2024
92a6e11
Merge branch 'main' into Alpha-v9.4
CyanVoxel Jul 19, 2024
bebca63
use list widget for selecting fields to add (#134)
yedpodtrzitko Jul 19, 2024
aa0aad4
Copy and Paste + Shortcuts (#79)
Creepler13 Jul 19, 2024
e463635
Add font thumbnail preview support (#307)
Thesacraft Jul 19, 2024
34f347b
Fix text and RAW image handling
CyanVoxel Jun 1, 2024
3c27b37
Use chardet for character encoding detection
CyanVoxel Jun 1, 2024
7ce3519
Add support for waveform + album cover thumbnails
CyanVoxel Jun 4, 2024
6b892ce
Rename "cover" variables for MyPy
CyanVoxel Jun 4, 2024
ff17b93
Rename "audio_tags" variables for MyPy + typing
CyanVoxel Jun 4, 2024
c1cd96f
Add # type: ignore to fromstring method
CyanVoxel Jun 4, 2024
3144440
Add GIF preview support
CyanVoxel Jun 4, 2024
d339f86
Add rough check for invalid video codecs
CyanVoxel Jun 8, 2024
dc135f7
Add ".plist" to PLAINTEXT_TYPES
CyanVoxel Jun 8, 2024
10d81b3
Add readable video tester
CyanVoxel Jun 9, 2024
087176e
Add ".psd" to IMAGE_TYPES; Handle ID3NoHeaderError
CyanVoxel Jun 13, 2024
cee4254
Improve and style waveform previews
CyanVoxel Jun 15, 2024
127fed7
Add final return statement to _album_artwork()
CyanVoxel Jun 15, 2024
32257f6
Add final return statement to _audio_waveform()
CyanVoxel Jun 15, 2024
3e00a77
Tweak waveform color and size
CyanVoxel Jun 15, 2024
1529714
Fix ItemThumb label text color in light mode
CyanVoxel Jun 15, 2024
d2b5e31
Fix most theme UI legibility issues
CyanVoxel Jun 15, 2024
05a4860
Match additional UI to color scheme
CyanVoxel Jun 16, 2024
c582f3d
ruff format
CyanVoxel Jul 19, 2024
c0e56dc
feat(ui): add UI color palette dict
CyanVoxel Jul 19, 2024
598aa4f
feat(ui) center and color small font previews
CyanVoxel Jul 19, 2024
ffdfd6c
fix(ui): large font previews follow app theme
CyanVoxel Jul 20, 2024
3bfeb3c
fix(ui): blender previews follow app theme
CyanVoxel Jul 20, 2024
086fc1e
feat(ui): add resizable thumbnail options
CyanVoxel Jul 20, 2024
ef8cc6c
fix: mkv files with "[0][0][0][0]" codec load properly
CyanVoxel Jul 20, 2024
ad53f10
fix: missing audio files properly handled
CyanVoxel Jul 20, 2024
91ee242
feat(ui): use system accent color for thumb selections
CyanVoxel Jul 20, 2024
196c1ba
fix(ui): hide gif preview in multi-selections
CyanVoxel Jul 20, 2024
3932414
feat(ui): add dynamic file thumb icons
CyanVoxel Jul 21, 2024
c6a5202
fix(ui): hide previous thumbnail before resizing
CyanVoxel Jul 22, 2024
ad12d64
(fix): catch ffmpeg errors in file tester
CyanVoxel Jul 25, 2024
8d2e67d
Squashed commit of the following:
CyanVoxel Jul 25, 2024
6883f9e
feat(ui): add media types and icon resources
CyanVoxel Jul 25, 2024
30b60a0
feat(ui): sort tags in add tag panel by color/alphabetical (close #32…
samuellieberman Jul 29, 2024
b107fb5
refactor: move type constants to new media classes (#331)
CyanVoxel Aug 21, 2024
447b5e6
feat(ui): add more default media types and icons
CyanVoxel Aug 21, 2024
c070f84
fix: remove leading dot in preview panel ext
CyanVoxel Aug 21, 2024
a244098
refactor: remove edge from `four_corner_gradient()`
CyanVoxel Aug 21, 2024
f91861d
fix: handle missing files in `resource_manager`
CyanVoxel Aug 21, 2024
e4f7055
fix(ui): thumb edges fading on refresh
CyanVoxel Aug 21, 2024
9388325
Merge branch 'main' into Alpha-v9.4
CyanVoxel Aug 21, 2024
387baae
Merge branch 'Alpha-v9.4' into thumbnails
CyanVoxel Aug 21, 2024
81dfb50
feat(ui): add default icons for audio+vector thumbs
CyanVoxel Aug 21, 2024
a658fc4
feat(ui): apply edge to default icon thumbs
CyanVoxel Aug 21, 2024
ccf3d78
chore: remove unused code
CyanVoxel Aug 21, 2024
148f792
refactor(ui): move loading icon to `ResourceManager`
CyanVoxel Aug 21, 2024
9f688cd
fix(ui) color for default icons follow theme
CyanVoxel Aug 23, 2024
c377b9d
fix: remove `theme_color` redef
CyanVoxel Aug 23, 2024
bee3083
feat: Add thumbnail extraction for ePub files
JorgeRui Aug 24, 2024
de95905
Added comments
JorgeRui Aug 24, 2024
c51f986
Merge branch 'main' into Alpha-v9.4
CyanVoxel Aug 25, 2024
fda6077
chore: bump version to v9.4.0
CyanVoxel Aug 26, 2024
5ac40f5
Add the ability to create tags when adding a tag to a file (#262)
bjorn-out Aug 28, 2024
41087b1
Merge branch 'main' into Alpha-v9.4
CyanVoxel Aug 31, 2024
d8ef543
fix(dupes): fix duplicate file matching (#410)
Toby222 Aug 31, 2024
4590226
feat(ui): expanded thumbnail and preview features (#390)
CyanVoxel Aug 31, 2024
569390e
fix: correct behavior for tag widget search options (#398)
CyanVoxel Aug 31, 2024
dcb8ded
ui: "open in explorer" action follows os name (#370)
SupKittyMeow Aug 31, 2024
341aa92
feat(ui): preview support for source engine files
FavroiteGamers Sep 1, 2024
85d62e6
fix: gdl sidecar files load properly
Computerdores Sep 1, 2024
8219ffc
feat: expanded file deletion/trashing (#409)
CyanVoxel Sep 1, 2024
81ddf53
fix(ui): unlinked videos use correct icon
CyanVoxel Sep 1, 2024
cc2e9f9
ui: increase thumbnail edge contrast
CyanVoxel Sep 1, 2024
cb12956
fix(ui): deleting files will not reset search
CyanVoxel Sep 1, 2024
65237ed
fix(ui): seek next valid video frame for thumbs
CyanVoxel Sep 1, 2024
3d42799
fix(ui): remove default video border
CyanVoxel Sep 1, 2024
7f3b3d0
ui: update splash
CyanVoxel Sep 1, 2024
ca08ce5
ui: postpone creating modals (#425)
yedpodtrzitko Sep 1, 2024
1e4883c
fix(ui): scale splash screen with screen width
CyanVoxel Sep 2, 2024
1c53f05
chore: ensure splash width is `int`
CyanVoxel Sep 2, 2024
9a78bf3
feat(ui): show file creation/modified dates + restyle path label (#430)
CyanVoxel Sep 2, 2024
85b6d9d
Merge branch 'main' into Alpha-v9.4
CyanVoxel Sep 3, 2024
fc714e0
fix: Do not create command prompt window on subprocess (#436)
seakrueger Sep 3, 2024
5995e4d
feat: add `.orf` file to `_IMAGE_RAW_SET`
CyanVoxel Sep 7, 2024
8c9b04d
fix(ui): use `birthtime` for creation time on mac & win (#472)
seakrueger Sep 8, 2024
bf8816f
fix(ui): use default audio icon if ffmpeg is absent (#471)
seakrueger Sep 8, 2024
4d405b5
feat: add `.raf` file to `_IMAGE_RAW_SET`
CyanVoxel Sep 8, 2024
6ff7303
fix: use `birthtime` for default library sorting
CyanVoxel Sep 9, 2024
dfa4079
fix(ui): retain filter on directory refresh (#483)
seakrueger Sep 10, 2024
6490cc9
feat: increase file scanning performance (#486)
CyanVoxel Sep 12, 2024
b2dbc57
feat(ui): warn user if FFmpeg not installed (#441)
seakrueger Sep 14, 2024
90b9af4
chore: bump version to v9.4.1
CyanVoxel Sep 14, 2024
2fc0dd0
ui: increase thumbnail edge contrast
CyanVoxel Sep 14, 2024
7765e58
Merge branch 'Alpha-v9.4' into epub_cover
CyanVoxel Sep 15, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/apprun.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ jobs:
libxcb-xinerama0 \
libopengl0 \
libxcb-cursor0 \
libpulse0
libpulse0 \
ffmpeg

- name: Install dependencies
run: |
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ If you're interested in contributing to TagStudio, please take a look at the [co

To download TagStudio, visit the [Releases](https://github.com/TagStudioDev/TagStudio/releases) section of the GitHub repository and download the latest release for your system under the "Assets" section. TagStudio is available for **Windows**, **macOS** _(Apple Silicon & Intel)_, and **Linux**. Windows and Linux builds are also available in portable versions if you want a more self-contained executable to move around.

For video thumbnails and playback, you'll also need [FFmpeg](https://ffmpeg.org/download.html) installed on your system.

> [!IMPORTANT]
> On macOS, you may be met with a message saying _""TagStudio" can't be opened because Apple cannot check it for malicious software."_ If you encounter this, then you'll need to go to the "Settings" app, navigate to "Privacy & Security", and scroll down to a section that says _""TagStudio" was blocked from use because it is not from an identified developer."_ Click the "Open Anyway" button to allow TagStudio to run. You should only have to do this once after downloading the application.

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[tool.ruff]
exclude = ["main_window.py", "home_ui.py", "resources.py", "resources_rc.py"]
exclude = ["main_window.py", "home_ui.py", "resources.py", "resources_rc.py", "**/vendored/"]

[tool.mypy]
strict_optional = false
disable_error_code = ["union-attr", "annotation-unchecked", "import-untyped"]
explicit_package_bases = true
warn_unused_ignores = true
exclude = ['tests']
exclude = ['tests', 'src/qt/helpers/vendored']
6 changes: 6 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,9 @@ numpy==1.26.4
rawpy==0.21.0
pillow-heif==0.16.0
chardet==5.2.0
pydub==0.25.1
mutagen==1.47.0
numpy==1.26.4
ffmpeg-python==0.2.0
Send2Trash==1.8.3
vtf2img==0.1.0
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tagstudio/resources/qt/images/file_icons/font.png
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.
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.
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.
Binary file added tagstudio/resources/qt/images/file_icons/text.png
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.
Binary file modified tagstudio/resources/qt/images/splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed tagstudio/resources/qt/images/thumb_border_512.png
Binary file not shown.
Binary file removed tagstudio/resources/qt/images/thumb_broken_512.png
Binary file not shown.
Binary file not shown.
Binary file added tagstudio/resources/qt/images/thumb_loading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed tagstudio/resources/qt/images/thumb_loading_512.png
Binary file not shown.
Binary file not shown.
Binary file removed tagstudio/resources/qt/images/thumb_mask_128.png
Binary file not shown.
Binary file removed tagstudio/resources/qt/images/thumb_mask_512.png
Diff not rendered.
Binary file removed tagstudio/resources/qt/images/thumb_mask_hl_512.png
Diff not rendered.
Binary file added tagstudio/resources/qt/videos/placeholder.mp4
Binary file not shown.
117 changes: 4 additions & 113 deletions tagstudio/src/core/constants.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION: str = "9.3.2" # Major.Minor.Patch
VERSION: str = "9.4.1" # Major.Minor.Patch
VERSION_BRANCH: str = "" # Usually "" or "Pre-Release"

# The folder & file names where TagStudio keeps its data relative to a library.
Expand All @@ -7,118 +7,10 @@
COLLAGE_FOLDER_NAME: str = "collages"
LIBRARY_FILENAME: str = "ts_library.json"

# TODO: Turn this whitelist into a user-configurable blacklist.
IMAGE_TYPES: list[str] = [
".png",
".jpg",
".jpeg",
".jpg_large",
".jpeg_large",
".jfif",
".gif",
".tif",
".tiff",
".heic",
".heif",
".webp",
".bmp",
".svg",
".avif",
".apng",
".jp2",
".j2k",
".jpg2",
]
RAW_IMAGE_TYPES: list[str] = [
".raw",
".dng",
".rw2",
".nef",
".arw",
".crw",
".cr2",
".cr3",
]
VIDEO_TYPES: list[str] = [
".mp4",
".webm",
".mov",
".hevc",
".mkv",
".avi",
".wmv",
".flv",
".gifv",
".m4p",
".m4v",
".3gp",
]
AUDIO_TYPES: list[str] = [
".mp3",
".mp4",
".mpeg4",
".m4a",
".aac",
".wav",
".flac",
".alac",
".wma",
".ogg",
".aiff",
]
DOC_TYPES: list[str] = [
".txt",
".rtf",
".md",
".doc",
".docx",
".pdf",
".tex",
".odt",
".pages",
]
PLAINTEXT_TYPES: list[str] = [
".txt",
".md",
".css",
".html",
".xml",
".json",
".js",
".ts",
".ini",
".htm",
".csv",
".php",
".sh",
".bat",
]
SPREADSHEET_TYPES: list[str] = [".csv", ".xls", ".xlsx", ".numbers", ".ods"]
PRESENTATION_TYPES: list[str] = [".ppt", ".pptx", ".key", ".odp"]
ARCHIVE_TYPES: list[str] = [
".zip",
".rar",
".tar",
".tar",
".gz",
".tgz",
".7z",
".s7z",
]
PROGRAM_TYPES: list[str] = [".exe", ".app"]
SHORTCUT_TYPES: list[str] = [".lnk", ".desktop", ".url"]

ALL_FILE_TYPES: list[str] = (
IMAGE_TYPES
+ VIDEO_TYPES
+ AUDIO_TYPES
+ DOC_TYPES
+ SPREADSHEET_TYPES
+ PRESENTATION_TYPES
+ ARCHIVE_TYPES
+ PROGRAM_TYPES
+ SHORTCUT_TYPES
FONT_SAMPLE_TEXT: str = (
"""ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!?@$%(){}[]"""
)
FONT_SAMPLE_SIZES: list[int] = [10, 15, 20]

BOX_FIELDS = ["tag_box", "text_box"]
TEXT_FIELDS = ["text_line", "text_box"]
Expand Down Expand Up @@ -163,6 +55,5 @@
"cool gray",
"olive",
]

TAG_FAVORITE = 1
TAG_ARCHIVED = 0
4 changes: 3 additions & 1 deletion tagstudio/src/core/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ class SettingItems(str, enum.Enum):


class Theme(str, enum.Enum):
COLOR_BG = "#65000000"
COLOR_BG_DARK = "#65000000"
COLOR_BG_LIGHT = "#22000000"
COLOR_DARK_LABEL = "#DD000000"
COLOR_HOVER = "#65AAAAAA"
COLOR_PRESSED = "#65EEEEEE"
COLOR_DISABLED = "#65F39CAA"
Expand Down
Loading