jenkins-bot has submitted this change and it was merged.
Change subject: Fix text extraction on DjVu so that it works beyond first call.
......................................................................
Fix text extraction on DjVu so that it works beyond first call.
This was caching the metadata tree in-process, but it was
returning this cache even for calls for things other then this
item.
As a result, if you did $file->getHandler()->getPageText( $file, 2 )
twice in a single request, the second time it would return false.
Change-Id: I6ee4dce3177c0898e98210d7471cfadc1108ca52
---
M includes/media/DjVu.php
1 file changed, 4 insertions(+), 1 deletion(-)
Approvals:
Gergő Tisza: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/media/DjVu.php b/includes/media/DjVu.php
index ae46b2e..cbb3ec2 100644
--- a/includes/media/DjVu.php
+++ b/includes/media/DjVu.php
@@ -232,7 +232,10 @@
* @return bool
*/
function getMetaTree( $image, $gettext = false ) {
- if ( isset( $image->dejaMetaTree ) ) {
+ if ( $gettext && isset( $image->djvuTextTree ) ) {
+ return $image->djvuTextTree;
+ }
+ if ( !$gettext && isset( $image->dejaMetaTree ) ) {
return $image->dejaMetaTree;
}
--
To view, visit https://gerrit.wikimedia.org/r/99696
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I6ee4dce3177c0898e98210d7471cfadc1108ca52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
Gerrit-Reviewer: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: Tpt <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits