[
https://issues.apache.org/jira/browse/TIKA-5041?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18139819#comment-18139819
]
ASF GitHub Bot commented on TIKA-5041:
--------------------------------------
tballison commented on PR #3553:
URL: https://github.com/apache/tika/pull/3553#issuecomment-6693021880
Bot nits. Some sound legit.
```
1. Build break. forbiddenapis rejects String.format without a locale at
TarParserTest.java:95. Use
String.format(Locale.ROOT, ...). With that check skipped, all 59 module
tests pass.
2. The CB7 branch in ComicBookDetector is dead. I disabled the .cb7 name
and type checks, and Seven7ParserTest and
ComicBookFixturesTest still pass. That's because the 7z magic isn't
versioned, so the .cb7 glob or hint already
specializes it. The class javadoc itself says the detector is for "RAR
and tar". Only ComicBookDetectorTest pins that
branch. Drop it, which also makes the detector match what CHANGES and
the docs claim. POSIX tar doesn't need the
detector either, only GNU tar does, but that check is harmless.
3. ComicBook.isPage is inconsistent. It now splits names on \ as well as /
(for RAR4 names), but the __MACOSX/ exclusion
only matches the forward slash. Minor.
4. The tar cover pre-pass has an edge case. If the ParseContext supplies
an ArchiveStreamFactory with a non-default entry
encoding, TarFile (default encoding) and the stream return different
names, so the cover is silently lost. The pre-pass
also copies a streamed .cbt to a temp file and reads it a second time.
Both are low priority.
Hygiene
- TarParserTest: the new test was inserted between testEmbedded's javadoc
and its method, so that javadoc is now orphaned
(lines 48–51).
- RarParserTest: uses a fully qualified java.util.LinkedHashMap; import it
instead.
```
> Comic book archives in RAR, 7z and tar (.cbr, .cb7, .cbt): detect them and
> emit the cover as THUMBNAIL
> ------------------------------------------------------------------------------------------------------
>
> Key: TIKA-5041
> URL: https://issues.apache.org/jira/browse/TIKA-5041
> Project: Tika
> Issue Type: Improvement
> Components: mime, parser
> Reporter: Dominik Schmidt
> Priority: Major
>
> TIKA-5032 handles comic book archives in a zip container ({{.cbz}},
> {{application/vnd.comicbook+zip}}): the first page in name order is the cover
> and is emitted as {{THUMBNAIL}}. The same convention exists for other
> containers, with no type in tika-mimetypes.xml today:
> * {{.cbr}}: RAR, IANA-registered as {{application/vnd.comicbook-rar}}
> (shared-mime-info: sub-class of {{application/vnd.rar}}, alias
> {{application/x-cbr}})
> * {{.cb7}}: 7z, {{application/x-cb7}} in shared-mime-info
> * {{.cbt}}: tar, {{application/x-cbt}} in shared-mime-info
> Registering them as sub-types of their container would let RarParser,
> SevenZParser and the tar path open them; picking the cover needs the full
> entry list, like the zip case. RAR support is limited (RAR5), so {{.cbr}} may
> only partly work.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)