Skip to content

Conversation

@Sola-ris
Copy link
Contributor

@Sola-ris Sola-ris commented Sep 8, 2025

Summary

Add Support for rendering .cbr thumbnails via rarfile.
Fixes #1051

The bit about installing unrar on Mac might not be entirely correct since I don't own a Mac to check, so I just looked at the installation instructions for FFmpeg and the available formulae on Homebrew.

I also checked if Windows 11's builtin rar support could be used, but I couldn't find anything concrete on how explorer opens rars and there's no unrar binary available either.

Before

rar-before

After

rar-after

Files used for testing

Renamed to .cbr.zip because GitHub.

Tasks Completed

  • Platforms Tested:
    • Windows x86
    • Windows ARM
    • macOS x86
    • macOS ARM
    • Linux x86
    • Linux ARM
  • Tested For:
    • Basic functionality
    • PyInstaller executable

Copy link
Collaborator

@Computerdores Computerdores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

works on win10 and code lgtm

@Computerdores Computerdores moved this to 🍃 Pending Merge in TagStudio Development Sep 8, 2025
@Computerdores Computerdores added Type: Enhancement New feature or request Thumbs/Previews File thumbnails or previews labels Sep 8, 2025
Copy link
Member

@CyanVoxel CyanVoxel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On macOS 15 with the unrar/rar package installed from homebrew (already had it) it seems to work with the one preexisting .cbr file I had but the provided can't be rendered due to a BadRarFile exception. For these I took the downloads and simply removed the .zip extension from the filenames without modifying the files themselves, just like for the previous .cbz files. Is that still correct?

Update: So it turns out that the homebrew cask installs both rar and unrar, which are slightly different entities:

> rar help

RAR 7.12   Copyright (c) 1993-2025 Alexander Roshal   23 Jun 2025
Trial version             Type 'rar -?' for help
> unrar help

UNRAR 7.12 freeware      Copyright (c) 1993-2025 Alexander Roshal

Which caused the issue in my case, because both needed to be let through the "Privacy & Security" pane in the macOS settings, and beforehand I had only ever used the rar command. Presumably the unrar command is more focused on unarchiving, but up to this point I had just called rar x to extract .rar archives so maybe this is just me being dumb in an unrelated way.

The quirky part for me is that not only did I still have that one .cbr file render just fine, but I didn't get the prompt to allow unrar until after I removed the try/catch block in _epub_cover() to dig further into the exception, however I'm hoping that was just a bizarre coincidence.

image

All that is to say, I suppose it's working on my end? I'll probably end up throwing a disclaimer callout for mac users in this section afterwards with some more succinct warnings and instructions. But otherwise, this all looks good to me - thank you for your work on this!

@CyanVoxel CyanVoxel added this to the Alpha v9.5.5 milestone Sep 8, 2025
@CyanVoxel CyanVoxel merged commit 2eb9aad into TagStudioDev:main Sep 8, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from 🍃 Pending Merge to ✅ Done in TagStudio Development Sep 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Thumbs/Previews File thumbnails or previews Type: Enhancement New feature or request

Projects

Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

[Bug]: Incorrect images used as cover previews for .cbr and .cbz files

3 participants