Page MenuHomePhabricator

[Regression] DjVu size info not extracted, thumbs failing
Closed, DeclinedPublic

Description

See URL. Some weird output instead of size info somewhere, probably: we even have "× pixels, file size: 93 KB, MIME type: image/vnd.djvu" shown in a pre, thumbs URLs are not even included.
Seems a regression because the file had been added to https://no.wikipedia.org/wiki/Kristnisaga
Bigger example at https://commons.wikimedia.org/wiki/File:Federal_Cases_28_extra.djvu


Version: unspecified
Severity: normal
URL: https://commons.wikimedia.org/wiki/File:Kristnisaga.djvu

Details

Reference
bz41388

Related Objects

Event Timeline

bzimport raised the priority of this task from to Medium.Nov 22 2014, 1:15 AM
bzimport set Reference to bz41388.
bzimport added a subscriber: Unknown Object (MLST).

Testing with several other Djvu files on Wikisource they can still be opened, it's "just" the preview being broken. Checking if this Djvu file is broken itself woudl also be good. => Normal priority.

Note that the visual outcome here is similar to PDF bug 41281 (but that does not mean that it's the same code failing).

(In reply to comment #1)

Testing with several other Djvu files on Wikisource they can still be opened,
it's "just" the preview being broken.

Which other DjVu? If you find more like this, please report them.

Checking if this Djvu file is broken
itself woudl also be good.

The DjVu surely has some oddity and this bug is about finding it, but okular opens it without a glitch.

For the message it seems that you have 'w x h' of 'MediaWiki:file-info-size. w and h are substituded with blanks because they are not known and then you have " x ", which is then parsed as wiki text, which converts the leading spacing to a pre block.

Solution is to insert ' ' or '0' into the message if the size cannot be calculated (seems most other media formats use '0'.

This issue probably became visible only last year, since then we moved the () outside of MediaWiki:file-info-size.

I don' know what's the best way to show info about a DjVu, but:

$ ddjvu -verbose /var/tmp/Federal_Cases_28_extra.djvu > /dev/null

  • page 1 -------

This is a legal Compound DjVu image.
DJVU Image (2839x4078, 300 dpi) version 25:

0.0 Kb 'INFO' Page information.
0.0 Kb 'CIDa' Unrecognized chunk.
8.6 Kb 'Sjbz' JB2 foreground mask (2839x4078, 300 dpi).
0.2 Kb 'FG44' IW44 foreground colors (237x340, 25 dpi).
1.1 Kb 'BG44' IW44 background (947x1360, 100 dpi).
0.2 Kb 'BG44' IW44 background (part 2, 100 dpi).
0.0 Kb 'BG44' IW44 background (part 3, 100 dpi).
0.3 Kb 'BG44' IW44 background (part 4, 100 dpi).
0.9 Kb 'TXTz' Text (text, etc.).

Compression ratio: 2976 (11.4 Kb)
Decoding time: 42 ms
Rendering time: 125 ms
Producing PPM file.

See also bug 37764 which is about the API not returning metadata for DjVU files. It has a patch in Gerrit change #24660.

To clarify, is there anything still needing doing here? https://commons.wikimedia.org/wiki/File:Federal_Cases_28_extra.djvu looks fine to me.

(In reply to Bawolff (Brian Wolff) from comment #8)

To clarify, is there anything still needing doing here?
https://commons.wikimedia.org/wiki/File:Federal_Cases_28_extra.djvu looks
fine to me.

The spacepre was fixed because it now says "0 × 0 pixel", but the DjVu is still not rendered: no size information, no thumbnails. Okular reads it fine.

Umm, I get:

Original file ‎(2,839 × 4,078 pixels, file size: 79.16 MB, MIME type: image/vnd.djvu, 1,410 pages) with a thumbnail, etc for the file from commons

The WikiLivres one looks broken, but that's probably due to a configuration issue on their end (Probably $wgDjvuDump is set to the wrong thing or something)

(In reply to Marco from comment #11)

Sorry, I misclicked. (The
https://commons.wikimedia.org/wiki/File:Federal_Cases_28_extra.djvu is
working but the other djvus are not)

https://commons.wikimedia.org/wiki/File:Kristnisaga.djvu

Action=purge seemed to fix that for me. Any other known examples?

Closing again as per comment 12.

Gilles raised the priority of this task from Medium to Unbreak Now!.Dec 4 2014, 10:11 AM
Gilles moved this task from Untriaged to Done on the Multimedia board.
Gilles lowered the priority of this task from Unbreak Now! to Medium.Dec 4 2014, 11:22 AM