https://bugzilla.wikimedia.org/show_bug.cgi?id=37692

       Web browser: ---
             Bug #: 37692
           Summary: Assumes one-based page numbers; doesn't work with
                    ImageMagick 6.7.7-2 which returns zero-based page
                    numbers
           Product: MediaWiki extensions
           Version: master
          Platform: All
        OS/Version: Mac OS X 10.7
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: PagedTiffHandler
        AssignedTo: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]
    Classification: Unclassified
   Mobile Platform: ---


Installed the extension on my local test wiki running from master. Got the
extension through a git clone of the PagedTiffHandler master.

After I had set it up, I was no longer able to upload tiff files.

Some debugging revealed that PagedTiffHandler.image.php assumed that the page
numbers as returned by ImageMagick's identify command started at 1. However, my
ImageMagick 6.7.7-2 returns zero-based page numbers (i.e., the first page got
"page=0"). As a result, the extension always complained about "inconsistent
page numbering in TIFF directory" in PagedTiffInfoParserState::finishPage() on
the first page since $this->prevPage is also initialized to zero.

I don't know whether other versions of ImageMagick return one-based page
numbers.

I fixed this locally by hacking in mapping zero-based page numbers to one-based
numbers in parseIdentifyOutput(), and then the extension worked as advertized.

-- 
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to