diff options
author | Dreamy Jazz <wpgbrown@wikimedia.org> | 2024-01-04 14:30:23 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2024-01-04 14:30:23 +0000 |
commit | 7f565575c9dd16089b1d0f8abe0853595d5ec9d0 (patch) | |
tree | 6cd0c0019af2eaddde2c6e8966ae0bc6c503499d | |
parent | c17ea04fdf9d807d1317bdfc1a8411cd4ae3f91b (diff) |
Update git submoduleswmf/1.42.0-wmf.10
* Update extensions/MediaModeration from branch 'wmf/1.42.0-wmf.10'
to 2b3ac9bbdb60247a0a34f2c56a9af2c30f925188
- Attempt to send original file to PhotoDNA if no thumbnail
Why:
* The call to File::transform on testwiki produced a fair number of
failures and also there were many SHA-1 values only present in the
filearchive table.
* Attempting to send the source image to PhotoDNA when the mime type of
the original file is supported in both of these cases allows the code
to still send an image to PhotoDNA for a scan.
* Sending the original source file is not the preferred option, as
large source files will not be scannable by PhotoDNA. However, as a
backup it is a good option in the majority of cases.
What:
* Move code related to generating a thumbnail from File objects out
of the MediaModerationPhotoDNAServiceProvider into the
MediaModerationImageContentsLookup for ease of testing and
readability.
* Add code to MediaModerationImageContentsLookup to lookup the
contents of the source file for both File and ArchivedFile objects.
* Update existing and new code that generates file contents to both
check that the thumbnail/file is at least 160px by 160px and also
is not larger in size than 4MB.
* Create a public method named ::getImageContents in the new service
that first tries to get the contents of a thumbnail and if this
fails tries to get the contents of the source file. If the $file
object is an ArchivedFile instance, then the code skips to just
trying to get the source file contents.
* Make ::getImageContents return a object of the ImageContentsLookup
Status, which extends StatusValue. This stores the mime type and
image contents for use by the caller with getter methods that will
work if the status is good.
* Move the unit tests to reflect the new structure for the code that
generates thumbnail contents.
* Add new unit tests for the new code.
Bug: T353854
Change-Id: If993b097233f8279ecafae39d53dfcf8ef914d09
(cherry picked from commit 3022fb27ce6af6da3b265bfc09152253da06ce78)
m--------- | extensions/MediaModeration | 0 |
1 files changed, 0 insertions, 0 deletions
diff --git a/extensions/MediaModeration b/extensions/MediaModeration -Subproject c5c82c4480d3d455a0f48a73c5a9306a7000e38 +Subproject 2b3ac9bbdb60247a0a34f2c56a9af2c30f92518 |