HomePhabricator

Extract load_image() function

Description

Extract load_image() function

This code was basically duplicated between load_item_and_property() and
load_file(), for no good reason as far as I can tell. load_file() needs
the page ID (unlike load_item_and_property()), but it doesn’t cost us
anything to query that (it’s always included in the response, it doesn’t
have a separate prop that you could leave out to save bandwidth or
anything), so we can just always return that as the image_page_id, and
then have load_file() translate that into the entity_id.

This prepares for adding the image size (width, height) to the HTML,
which is another piece of API information that shouldn’t be duplicated.

Details

Provenance
LucasWerkmeisterAuthored on May 14 2022, 11:06 AM
Parents
R2422:ecae67b92428: Fix item ID input handling
Branches
Unknown
Tags
Unknown
ChangeId
None