Brian Wolff has uploaded a new change for review.
https://gerrit.wikimedia.org/r/99696
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(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core
refs/changes/96/99696/1
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: newchange
Gerrit-Change-Id: I6ee4dce3177c0898e98210d7471cfadc1108ca52
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Brian Wolff <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits