Page MenuHomePhabricator

Gallery image search not returning results when there is a pdf in the result set
Open, Needs TriagePublicBUG REPORT


Steps to reproduce:

  • Upload images and pdf's with a similar name. eg (mycat.png, category.jpg, cat1.pdf)
  • Edit Page
  • Insert Gallery
  • Enter a term in the search box that matches a known image name and a known pdf filename. eg. cat

Expected result:

  • 2 results with thumbnails for mycat.png and category.jpg

Actual Result:

No results returned
Ajax result contains message like 'Could not normalize image parameters for cat1.pdf'

If I change the search query to:

-filemime:pdf cat

I get results correctly.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Hi @Jandrews377, thanks for taking the time to report this and welcome to Wikimedia Phabricator! Which software version is this about?

Hi @Aklapper. Thanks for taking the time to reply. Our Versions:

  • mediawiki 1.34
  • thenets/parsoid:0.11
  • pastakhov/restbase:0.16.9
  • elasticsearch:6.5.4

All of the modules are using the 1.34 branch:

  • Echo
  • NoTitle
  • Spoilers
  • Thanks
  • CheckUser
  • Math
  • ExternalData
  • Flow
  • UploadWizard
  • Babel
  • cldr
  • CleanChanges
  • UniversalLanguageSelector
  • VisualEditor
  • CirrusSearch
  • Elastica
  • PDFEmbed

Could not normalize image parameters for ... is the message apierror-urlparamnormal. In a quick review this looks to only be emitted by ApiQueryImageInfo.

If you try and get the image info without search, does it also error? An example api request would be something like the following, but replace the title with a local pdf. This may depend on a very specific pdf being returned, rather than any arbitrary one, hard to say.

Hi EBernhardson,

Using your query, I don't get an error.
However, using the query the gallery generates for its ajax request, I get the error:


If I manipulate the request and remove the iiurlheight and iiurlwidth parameters, I am able to get a response, without issue.
It looks like the backend may be having trouble generating thumbnaisl for pdf's ? Unfortunately I dont see any errors.

Many thanks.

@ssastry , this looks like it may be less of a search issue and more related to the pdf handler