mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v1.8.3.1
This commit is contained in:
@@ -24,20 +24,20 @@ public class Xof_xfer_mgr {
|
||||
public Xof_xfer_mgr Force_orig_y_() {return Force_orig_(Bool_.Y);} public Xof_xfer_mgr Force_orig_n_() {return Force_orig_(Bool_.N);}
|
||||
public void Atrs_by_itm(Xof_xfer_itm xfer_itm, Xof_repo_itm src_repo, Xof_repo_itm trg_repo) {
|
||||
this.xfer_itm = xfer_itm;
|
||||
this.lnki_w = xfer_itm.Lnki_w(); this.lnki_h = xfer_itm.Lnki_h(); this.lnki_thumbable = xfer_itm.Lnki_thumbable(); this.lnki_thumbtime = xfer_itm.Lnki_thumbtime(); this.lnki_page = xfer_itm.Lnki_page();
|
||||
this.lnki_w = xfer_itm.Lnki_w(); this.lnki_h = xfer_itm.Lnki_h(); this.lnki_thumbable = xfer_itm.Img_is_thumbable(); this.lnki_thumbtime = xfer_itm.Lnki_thumbtime(); this.lnki_page = xfer_itm.Lnki_page();
|
||||
this.lnki_type = xfer_itm.Lnki_type();
|
||||
lnki_upright = xfer_itm.Lnki_upright();
|
||||
this.ttl = xfer_itm.Lnki_ttl(); this.md5 = xfer_itm.Lnki_md5(); this.ext = xfer_itm.Lnki_ext();
|
||||
orig_file_len = xfer_itm.Orig_file_len();
|
||||
this.orig_file_len = xfer_itm.Orig_file_len();
|
||||
this.src_repo = src_repo; src_repo_is_wmf = src_repo.Wmf_fsys();
|
||||
this.trg_repo = trg_repo;
|
||||
this.meta_itm = xfer_itm.Meta_itm();
|
||||
ext_rule = src_repo.Ext_rules().Get_or_null(ext.Ext());
|
||||
orig_w = 0; orig_h = 0; file_w = 0; file_h = 0;
|
||||
} private byte lnki_type;
|
||||
Xof_xfer_itm xfer_itm; double lnki_thumbtime = Xof_doc_thumb.Null; boolean lnki_thumbable; int lnki_w, lnki_h, file_w, file_h; double lnki_upright;
|
||||
Xof_ext ext; Xoft_rule_itm ext_rule; Xof_repo_itm src_repo, trg_repo; boolean src_repo_is_wmf; byte[] ttl, md5; int orig_w, orig_h, orig_file_len;
|
||||
int lnki_page = Xof_doc_page.Null;
|
||||
private Xof_xfer_itm xfer_itm; private double lnki_thumbtime = Xof_doc_thumb.Null; private boolean lnki_thumbable; private int lnki_w, lnki_h, file_w, file_h; private double lnki_upright;
|
||||
private Xof_ext ext; private Xoft_rule_itm ext_rule; private Xof_repo_itm src_repo, trg_repo; private boolean src_repo_is_wmf; private byte[] ttl, md5; private int orig_w, orig_h, orig_file_len;
|
||||
private int lnki_page = Xof_doc_page.Null;
|
||||
public Xof_meta_itm Meta_itm() {return meta_itm;} private Xof_meta_itm meta_itm;
|
||||
public boolean Download_allowed_by_ext() {return orig_file_len < ext_rule.Make_max();}
|
||||
public Xof_xfer_mgr Check_file_exists_before_xfer_n_() {check_file_exists_before_xfer = false; return this;} private boolean check_file_exists_before_xfer = true;
|
||||
@@ -55,7 +55,7 @@ public class Xof_xfer_mgr {
|
||||
else Make_other();
|
||||
return rslt.Pass();
|
||||
} private Xow_wiki wiki; Xof_img_wkr_api_size_base_rslts rslts = new Xof_img_wkr_api_size_base_rslts();
|
||||
boolean Make_img() {
|
||||
private boolean Make_img() {
|
||||
String src_str; Io_url trg_url;
|
||||
// BLOCK: thumb
|
||||
if (lnki_thumbable) { // lnki is thumb with known width >>> try to do thumb
|
||||
@@ -350,7 +350,7 @@ public class Xof_xfer_mgr {
|
||||
}
|
||||
String Src_url(Xof_repo_itm repo, byte mode, int lnki_w) {return url_bldr.Set_src_file_(mode, repo, ttl, md5, ext, lnki_w, lnki_thumbtime, lnki_page).Xto_str();}
|
||||
Io_url Trg_url(Xof_repo_itm repo, byte mode, int lnki_w) {return url_bldr.Set_trg_file_(mode, repo, ttl, md5, ext, lnki_w, lnki_thumbtime, lnki_page).Xto_url();}
|
||||
Xof_url_bldr url_bldr = new Xof_url_bldr();
|
||||
private Xof_url_bldr url_bldr = new Xof_url_bldr();
|
||||
}
|
||||
/*
|
||||
NOTE_1:always recalc w/h
|
||||
|
||||
@@ -50,8 +50,8 @@ public class Xof_xfer_queue {
|
||||
String queue_msg = wtr.Prog_many(GRP_KEY, "download.bgn", "downloading ~{0} of ~{1}: ~{2};", i + ListAdp_.Base1, xfer_len, xfer_itm.Lnki_ttl());
|
||||
wiki.App().File_mgr().Download_mgr().Download_wkr().Download_xrg().Prog_fmt_hdr_(queue_msg);
|
||||
wiki.File_mgr().Repo_mgr().Xfer_by_meta(xfer_itm, this);
|
||||
xfer_itm.Atrs_by_meta(xfer_itm.Meta_itm(), xfer_itm.Meta_itm().Repo_itm(wiki), wiki.Html_mgr().Img_thumb_width());
|
||||
xfer_itm.Atrs_calc_for_html();
|
||||
xfer_itm.Set__meta(xfer_itm.Meta_itm(), xfer_itm.Meta_itm().Repo_itm(wiki), wiki.Html_mgr().Img_thumb_width());
|
||||
xfer_itm.Calc_by_meta();
|
||||
if (!xfer_itm.Html_pass()) continue; // file not found; don't call Update_img, else invalid src will be passed and caption box will be incorrectly resized; EX:ar.d:جَبَّارَة; DATE:2014-04-13
|
||||
if (Bry_.Len_gt_0(xfer_itm.Html_view_src()) // only update images that have been found; otherwise "Undefined" shows up in image box
|
||||
&& xfer_itm.Html_elem_tid() != Xof_html_elem.Tid_none) { // skip updates when downloading orig on File page (there won't be any frame to update)
|
||||
|
||||
@@ -1,153 +0,0 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import org.junit.*;
|
||||
import gplx.ios.*; import gplx.gfui.*;
|
||||
public class Xof_xfer_queue_bldr_tar_tst {
|
||||
Xof_xfer_queue_bldr_fxt fxt = new Xof_xfer_queue_bldr_fxt();
|
||||
@Before public void init() {fxt.Clear(false);}
|
||||
@Test public void Png_orig() {
|
||||
fxt.Rdr("A.png|||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?90,80|")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Png_thumb() {
|
||||
fxt.Rdr("A.png|||10000|90|80|8|0||8,45,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/7/0/A.png/45px.png", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?90,80|1?45,40")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Png_many() {
|
||||
fxt.Rdr("A.png|||10000|90|80|8|0||0,-1,-1;8,45,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 90, 80)
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/7/0/A.png/45px.png", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?90,80|1?45,40")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Redirect() {
|
||||
fxt.Rdr("B.png|A.png||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?90,80|")
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/5/57.csv", "B.png|0|A.png|2?0,0|")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Long_file_name() {
|
||||
String name = String_.Repeat("A", 200);
|
||||
fxt.Rdr(name + ".png|||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/1/14/" + name + ".png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/1/4/" + String_.Repeat("A", (200 + 4) - (20 + 32 + 1 + 4)) + "_141b573216f8e4338f4f53409bd9d209.png", 90, 80) // SEE:NOTE_1
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/1/14.csv", name + ".png|0||1?90,80|")
|
||||
)
|
||||
.tst();
|
||||
fxt .Lnki_thumb_(name + ".png", 200)
|
||||
.Html_src_("file:///mem/trg/commons.wikimedia.org/raw/1/4/" + String_.Repeat("A", (200 + 4) - (20 + 32 + 1 + 4)) + "_141b573216f8e4338f4f53409bd9d209.png")
|
||||
.tst();
|
||||
}
|
||||
@Test public void Svg_orig() {
|
||||
fxt.Rdr("A.svg|||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.svg_("mem/src/commons.wikimedia.org/7/75/A.svg", 90, 80))
|
||||
.Trg( fxt.svg_("mem/trg/commons.wikimedia.org/raw/7/5/A.svg", 90, 80)
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/7/5/A.svg/90px.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/75.csv", "A.svg|0||1?90,80|1?90,80")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Svg_thumb() {
|
||||
fxt.Rdr("A.svg|||10000|90|80|8|0||8,45,-1")
|
||||
.Src( fxt.svg_("mem/src/commons.wikimedia.org/7/75/A.svg", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/7/5/A.svg/45px.png", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/75.csv", "A.svg|0||1?90,80|1?45,40")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Invalid() {
|
||||
fxt.Rdr("A\"*b.jpg|||10000|90|80|8|0||8,45,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/0/0f/A__b.jpg", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/0/f/A__b.jpg/45px.jpg", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/0/0f.csv", "A\"*b.jpg|0||1?90,80|1?45,40")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void LowerCase() {
|
||||
fxt.Rdr("a.png|||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?90,80|")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Nil_size_thumb() {
|
||||
fxt.Rdr("A.png|||0|0|0|0|0||8,45,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/7/0/A.png/45px.png", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?90,80|1?45,40"
|
||||
)
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Redirect_orig() {
|
||||
fxt.Rdr("B.png|A.png||0|0|0|0|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?90,80|")
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/5/57.csv", "B.png|0|A.png|2?0,0|")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Ogg() {
|
||||
fxt.Rdr("A.ogg|||0|0|0|0|0||0,50,100") // NOTE: ignore size even if set in lnk
|
||||
.Src( fxt.ogg_("mem/src/commons.wikimedia.org/4/42/A.ogg"))
|
||||
.Trg( fxt.ogg_("mem/trg/commons.wikimedia.org/raw/4/2/A.ogg")
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/4/42.csv", "A.ogg|0||1?0,0|")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Char_apos() { // PURPOSE: ' should not be url-encoded
|
||||
fxt.Rdr("A'b.png|||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/6/66/A'b.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/6/6/A'b.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/6/66.csv", "A'b.png|0||1?90,80|")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
}
|
||||
// Tfds.Write(gplx.xowa.files.Xof_xfer_itm_.Md5_(Bry_.new_utf8_("A,b.png")));
|
||||
|
||||
/*
|
||||
NOTE_1:String_.Repeat("A", (200 + 4) - (24 + 20 + 32 + 1 + 4))
|
||||
|
||||
+
|
||||
200: "A" repeated 200 times
|
||||
4: ".png"
|
||||
NOTE: 200 is 20 over max of 180
|
||||
|
||||
-
|
||||
20: amount over 180
|
||||
32: length of md5 hash; "141b573216f8e4338f4f53409bd9d209"
|
||||
1: length of _
|
||||
4: ".png"
|
||||
*/
|
||||
@@ -1,430 +0,0 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.xowa; import gplx.*;
|
||||
import org.junit.*;
|
||||
import gplx.ios.*; import gplx.xowa.files.*;
|
||||
public class Xof_xfer_queue_bldr_wmf_tst {
|
||||
Xof_xfer_queue_bldr_fxt fxt = new Xof_xfer_queue_bldr_fxt();
|
||||
@Before public void init() {fxt.Clear(true);}
|
||||
@Test public void Png_orig() {
|
||||
fxt.Rdr("A.png|||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 900, 800))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 900, 800)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv" , "A.png|0||1?900,800|")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Png_thumb() {
|
||||
fxt.Rdr("A.png|||10000|90|80|8|0||8,45,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/thumb/7/70/A.png/45px-A.png", 45, 40))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/7/0/A.png/45px.png", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||2?90,80|1?45,40")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Png_many() {
|
||||
fxt.Rdr("A.png|||10000|90|80|8|0||0,-1,-1;8,45,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 90, 80)
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/7/0/A.png/45px.png", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?90,80|1?45,40")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
// // Test: Thumb_resizeRaw; thumb does not exist; download orig and resize
|
||||
// // Test: Thumb_upright specified tstr.Lnki_("[[File:A.png|thumb|upright]]").Src_xfer_("170,160", "mem/wiki/c0/thumb/7/70/A.png/170px-A.png")
|
||||
// // Test: Thumb_height only specified "[[File:A.png|thumb|x50px]]").Src_xfer_("200,100", "mem/wiki/c0/7/70/A.png" -> 100,50
|
||||
@Test public void Svg_orig() {
|
||||
fxt.Rdr("A.svg|||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.svg_("mem/src/commons.wikimedia.org/7/75/A.svg", 90, 80))
|
||||
.Trg( fxt.svg_("mem/trg/commons.wikimedia.org/raw/7/5/A.svg", 90, 80) // NOTE: needs to download orig before converting
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/7/5/A.svg/90px.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/75.csv", "A.svg|0||1?90,80|1?90,80")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Svg_thumb() {
|
||||
fxt.Rdr("A.svg|||10000|90|80|8|0||8,45,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/thumb/7/75/A.svg/45px-A.svg.png", 45, 40))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/7/5/A.svg/45px.png", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/75.csv", "A.svg|0||2?90,80|1?45,40")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Nil_size_thumb() {
|
||||
fxt.Rdr("A.png|||0|0|0|0|0||8,45,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/thumb/7/70/A.png/45px-A.png", 45, 40))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/7/0/A.png/45px.png", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||2?0,0|1?45,40")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Nil_size_orig() {
|
||||
fxt.Rdr("A.png|||0|0|0|0|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?90,80|")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Nil_height() {
|
||||
fxt.Rdr("A.png|||0|0|0|0|0||8,-1,80")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 220, 160)
|
||||
, fxt.img_("mem/src/commons.wikimedia.org/thumb/7/70/A.png/220px-A.png", 220, 160) // NOTE: make sure default thumb is ignored; i.e.: 220 should not be substituted for -1; PAGE:en.w:Paris;[[File:IMA-Ile-St-Louis.jpg|thumb|x220]]
|
||||
)
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 220, 160)
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/7/0/A.png/110px.png", 110, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?220,160|1?220,160;1?110,80")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Nil_width_thumb() {
|
||||
fxt.Rdr("A.png|||0|0|0|0|0||8,-1,80")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 180, 160)
|
||||
, fxt.img_("mem/src/commons.wikimedia.org/thumb/7/70/A.png/220px-A.png", 220, 196) // NOTE: make sure default thumb is ignored
|
||||
, fxt.img_("mem/src/commons.wikimedia.org/thumb/7/70/A.png/90px-A.png", 90, 80) // NOTE: make sure default thumb is ignored
|
||||
)
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/7/0/A.png/90px.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||2?0,0|1?220,196;1?90,80")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Nil_width_wrong_width() {
|
||||
fxt.Rdr("A.svg|||0|0|0|0|0||8,65,50")
|
||||
.Src( fxt.svg_("mem/src/commons.wikimedia.org/7/75/A.svg", 160, 160))
|
||||
.Trg( fxt.svg_("mem/trg/commons.wikimedia.org/raw/7/5/A.svg", 160, 160)
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/7/5/A.svg/50px.png", 50, 50)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/75.csv", "A.svg|0||1?160,160|1?50,50")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Nil_width_wrong_width_2() { // PAGE:en.w:[[Image:Gnome-mime-audio-openclipart.svg|65x50px|center|link=|alt=]]
|
||||
fxt.Rdr("A.svg|||0|0|0|0|0||8,65,50")
|
||||
.Src( fxt.svg_("mem/src/commons.wikimedia.org/7/75/A.svg", 160, 160)
|
||||
, fxt.img_("mem/src/commons.wikimedia.org/thumb/7/75/A.svg/65px-A.svg.png", 65, 60))
|
||||
.Trg( fxt.svg_("mem/trg/commons.wikimedia.org/raw/7/5/A.svg", 160, 160)
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/7/5/A.svg/50px.png", 50, 50)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/75.csv", "A.svg|0||1?160,160|1?50,50")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Svg_thumb_irregular() {// PAGE:en.w:{{Olympic Summer Games Host Cities}};[[File:Flag of the United States.svg|22x20px]]
|
||||
fxt.Rdr("A.svg|||0|0|0|8|0||8,22,20")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/thumb/7/75/A.svg/22px-A.svg.png", 22, 12)
|
||||
)
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/7/5/A.svg/22px.png", 22, 12)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/75.csv", "A.svg|0||2?0,0|1?22,12")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Rounding_converts_to_double() {// bugfix wherein (double) is needed else integer division loses precision; PAGE:en.w:{{Olympic Summer Games Host Cities}};[[File:Flag of the United States.svg|22x20px]]
|
||||
fxt.Rdr("A.svg|||0|0|0|8|0||8,22,12")
|
||||
.Src( fxt.svg_("mem/src/commons.wikimedia.org/7/75/A.svg", 1235, 650))
|
||||
.Trg( fxt.svg_("mem/trg/commons.wikimedia.org/raw/7/5/A.svg", 1235, 650)
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/7/5/A.svg/22px.png", 22, 12)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/75.csv", "A.svg|0||1?1235,650|1?22,12")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Nil_width_thumb_missing() {
|
||||
fxt.Rdr("A.png|||0|0|0|0|0||8,-1,80")
|
||||
.Src()
|
||||
.Trg(fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|x||2?0,0|"))
|
||||
.tst();
|
||||
}
|
||||
@Test public void Missing_do_not_redownload() {
|
||||
fxt.Rdr("A.png|||0|0|0|0|0||8,45,40")
|
||||
.Src( fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|x||0?0,0|") // create reg and mark file missing
|
||||
, fxt.img_("mem/src/commons.wikimedia.org/thumb/7/70/A.png/45px-A.png", 45, 40)) // create thumb (but should be ignored)
|
||||
.Trg( fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|x||0?0,0|")) // note that 45,40 thumb does not show up
|
||||
.tst();
|
||||
}
|
||||
@Test public void Ogg() {
|
||||
fxt.Rdr("A.ogg|||0|0|0|0|0||0,-1,-1") // NOTE: ignore size even if set in lnk
|
||||
.Src( fxt.ogg_("mem/src/commons.wikimedia.org/4/42/A.ogg")
|
||||
, fxt.img_("mem/src/commons.wikimedia.org/thumb/4/42/A.ogg/mid-A.ogg.jpg", 300, 40)
|
||||
)
|
||||
.Trg( fxt.ogg_("mem/trg/commons.wikimedia.org/raw/4/2/A.ogg")
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/4/2/A.ogg/300px.jpg", 300, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/4/42.csv", "A.ogg|0||1?0,0|1?300,40"
|
||||
)
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Ogv_width_standard() {
|
||||
fxt.Rdr("A.ogv|||0|0|0|0|0||8,-1,-1") // NOTE: size matters for retrieval of thumb
|
||||
.Src( fxt.ogg_("mem/src/commons.wikimedia.org/d/d0/A.ogv")
|
||||
, fxt.img_("mem/src/commons.wikimedia.org/thumb/d/d0/A.ogv/mid-A.ogv.jpg", 300, 40)
|
||||
)
|
||||
.Trg( fxt.ogg_("mem/trg/commons.wikimedia.org/raw/d/0/A.ogv")
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/d/0/A.ogv/300px.jpg", 300, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/d/d0.csv", "A.ogv|0||1?0,0|1?300,40")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Ogv_width_custom() { // PAGE:en.w:Earth;Northwest coast of United States to Central South America at Night.ogv|250px
|
||||
fxt.Rdr("A.ogv|||0|0|0|0|0||8,250,-1")
|
||||
.Src( fxt.ogg_("mem/src/commons.wikimedia.org/d/d0/A.ogv")
|
||||
, fxt.img_("mem/src/commons.wikimedia.org/thumb/d/d0/A.ogv/mid-A.ogv.jpg", 640, 425)
|
||||
)
|
||||
.Trg( fxt.ogg_("mem/trg/commons.wikimedia.org/raw/d/0/A.ogv")
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/d/0/A.ogv/640px.jpg", 640, 425)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/d/d0.csv", "A.ogv|0||1?0,0|1?640,425")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Ogv_width_seek() {
|
||||
fxt.Rdr("A.ogv|||0|0|0|0|0||8,-1,-1,thumbtime=5") // NOTE: size matters for retrieval of thumb
|
||||
.Src( fxt.ogg_("mem/src/commons.wikimedia.org/d/d0/A.ogv")
|
||||
, fxt.img_("mem/src/commons.wikimedia.org/thumb/d/d0/A.ogv/seek%3D5-A.ogv.jpg", 300, 40)
|
||||
)
|
||||
.Trg( fxt.ogg_("mem/trg/commons.wikimedia.org/raw/d/0/A.ogv")
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/d/0/A.ogv/300px@5.jpg", 300, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/d/d0.csv", "A.ogv|0||1?0,0|1?300,40@5")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Djvu() {
|
||||
fxt.Rdr("A.djvu|||10000|0|0|8|0||8,45,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/thumb/7/76/A.djvu/page1-45px-A.djvu.jpg", 45, 40))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/7/6/A.djvu/45px.jpg", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/76.csv", "A.djvu|0||2?0,0|1?45,40")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Upright() { // PURPOSE: upright can generate thumb that is larger than orig; thumb is not on wmf, so orig must be used PAGE:en.w:Saint Petersburg [[File:Georgyj Poltavchenko.jpeg|thumb|left|upright]]
|
||||
fxt.Rdr("A.png|||0|0|0|0|0||8,-1,-1,upright=1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 148, 186))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 148, 186)
|
||||
// , fxt.img_("mem/trg/commons.wikimedia.org/fit/7/70/A.png/130px.png", 130, 163) // FUTURE: should delete these since they are not used
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?148,186|1?148,186" // NOTE: upright=1 calculates width of 220; but since orig < 220, use orig
|
||||
)
|
||||
)
|
||||
.tst();
|
||||
fxt.tst_html_src("file:///mem/trg/commons.wikimedia.org/fit/7/0/A.png/148px.png"); // NOTE: changed from raw/A.png to fit/148px.png; DATE:2014-05-23
|
||||
}
|
||||
@Test public void Url_encoding_valid() { // PURPOSE: A%2Cb should (a) not become A%252Cb on file_system but (b) should have md5 calculated on A,b and (c) should be copied down as "A,b"
|
||||
fxt.Rdr("A%2Cb.png|||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/d/d6/A%2Cb.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/d/6/A,b.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/d/d6.csv", "A,b.png|0||1?90,80|")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Url_encoding_invalid() { // PURPOSE: for invalid url encoding (%); note that A%b should not become A%25b on file_system
|
||||
// Tfds.Write_bry(Xof_xfer_itm_.Md5_calc(Bry_.new_ascii_("A%b.png")));
|
||||
fxt.Rdr("A%b.png|||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/9/98/A%25b.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/9/8/A%b.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/9/98.csv", "A%b.png|0||1?90,80|")
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Rounding() { // PURPOSE: bug; 3000,3002 image gets scaled to 99,99 instead of 100,100; PAGE:en.w:Solar System#Visual summary
|
||||
fxt.Rdr("A.png|||10000|3000|3002|8|0||0,100,100")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/7/70/A.png", 3000, 3002))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/7/0/A.png", 3000, 3002)
|
||||
, fxt.img_("mem/trg/commons.wikimedia.org/fit/7/0/A.png/100px.png", 100, 100)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/7/70.csv", "A.png|0||1?3000,3002|1?100,100"
|
||||
)
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Char_plus() {
|
||||
fxt.Rdr("A+b.png|||10000|90|80|8|0||0,-1,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/d/d3/A%2Bb.png", 90, 80))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/raw/d/3/A+b.png", 90, 80)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/d/d3.csv", "A+b.png|0||1?90,80|"
|
||||
)
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
@Test public void Pdf_thumb() {
|
||||
fxt.Rdr("A.pdf|||10000|0|0|8|0||0,45,-1")
|
||||
.Src( fxt.img_("mem/src/commons.wikimedia.org/thumb/e/ef/A.pdf/page1-45px-A.pdf.jpg", 45, 40))
|
||||
.Trg( fxt.img_("mem/trg/commons.wikimedia.org/fit/e/f/A.pdf/45px.jpg", 45, 40)
|
||||
, fxt.reg_("mem/xowa/file/#meta/en.wikipedia.org/e/ef.csv", "A.pdf|0||2?0,0|1?45,40"
|
||||
)
|
||||
)
|
||||
.tst();
|
||||
}
|
||||
}
|
||||
class Xof_xfer_queue_bldr_fxt extends Xof_xfer_queue_html_fxt { Xof_xfer_itm xfer_itm = new Xof_xfer_itm();
|
||||
Xof_xfer_queue queue = new Xof_xfer_queue();
|
||||
@gplx.New public Xof_xfer_queue_bldr_fxt Src(Io_fil... v) {return (Xof_xfer_queue_bldr_fxt)Src_base(v);}
|
||||
@gplx.New public Xof_xfer_queue_bldr_fxt Trg(Io_fil... v) {return (Xof_xfer_queue_bldr_fxt)Trg_base(v);}
|
||||
public Xof_xfer_queue_bldr_fxt Rdr(String... v) {rdr = String_.Concat_lines_nl(v); return this;} private String rdr;
|
||||
@Override public void Clear(boolean src_repo_is_wmf) {
|
||||
super.Clear(src_repo_is_wmf);
|
||||
bldr = Xoa_app_fxt.bldr_(this.App());
|
||||
wkr = new Xobc_img_run_xfer(bldr, this.En_wiki());
|
||||
GfoInvkAble_.InvkCmd_val(wkr, Xobc_img_run_xfer.Invk_rdr_dir_, "mem/rdr/");
|
||||
} private Xob_bldr bldr; Xobc_img_run_xfer wkr;
|
||||
@gplx.New public void tst() {
|
||||
ini_src_fils();
|
||||
Io_mgr._.SaveFilStr(wkr.Rdr_dir().GenSubFil("0000.csv"), rdr);
|
||||
wkr.Cmd_bgn(bldr);
|
||||
wkr.Cmd_run();
|
||||
wkr.Cmd_end();
|
||||
tst_trg_fils();
|
||||
}
|
||||
public void tst_html_src(String expd) {
|
||||
boolean found = wkr.Xfer_itm().Atrs_calc_for_html();
|
||||
Tfds.Eq(expd, String_.new_utf8_(wkr.Xfer_itm().Html_view_src()));
|
||||
Tfds.Eq(true, found, "img not found");
|
||||
}
|
||||
}
|
||||
///*
|
||||
// @Test public void Thumb_resizeRaw() { // thumb does not exist; download raw and resize
|
||||
// tstr.Lnki_("[[File:A.png|thumb]]").Src_xfer_("440,400", "mem/wiki/c0/7/70/A.png")
|
||||
// .Expd_xfer_fail_
|
||||
// ( "mem/wiki/c0/thumb/7/70/A.png/220px-A.png"
|
||||
// , "mem/wiki/en/thumb/7/70/A.png/220px-A.png"
|
||||
// )
|
||||
// .Expd_xfer_pass_
|
||||
// ( "mem/xowa/raw/7/0/A.png/440_400.png"
|
||||
// , "mem/xowa/fit/7/0/A.png/220_200.png")
|
||||
// .Expd_html_src_("file:///mem/xowa/fit/7/0/A.png/220_200.png")
|
||||
// .Expd_fit_reg_
|
||||
// ( "-1,-1|0|440,400"
|
||||
// , "220,-1|1|220,200"
|
||||
// )
|
||||
// .tst()
|
||||
// ;
|
||||
// }
|
||||
// @Test public void Thumb_upright() {
|
||||
// tstr.Lnki_("[[File:A.png|thumb|upright]]").Src_xfer_("170,160", "mem/wiki/c0/thumb/7/70/A.png/170px-A.png")
|
||||
// .Expd_xfer_fail_()
|
||||
// .Expd_xfer_pass_("mem/xowa/fit/7/0/A.png/170_160.png")
|
||||
// .Expd_html_src_("file:///mem/xowa/fit/7/0/A.png/170_160.png")
|
||||
// .Expd_fit_reg_
|
||||
// ( "170,-1|1|170,160"
|
||||
// )
|
||||
// .tst()
|
||||
// ;
|
||||
// }
|
||||
// @Test public void Thumb_height() {
|
||||
// tstr.Lnki_("[[File:A.png|thumb|x50px]]").Src_xfer_("200,100", "mem/wiki/c0/7/70/A.png")
|
||||
// .Expd_xfer_fail_()
|
||||
// .Expd_xfer_pass_
|
||||
// ( "mem/xowa/raw/7/0/A.png/200_100.png"
|
||||
// , "mem/xowa/fit/7/0/A.png/100_50.png"
|
||||
// )
|
||||
// .Expd_html_src_("file:///mem/xowa/fit/7/0/A.png/100_50.png")
|
||||
// .Expd_fit_reg_
|
||||
// ( "-1,-1|0|200,100"
|
||||
// , "-1,50|1|100,50"
|
||||
// )
|
||||
// .tst()
|
||||
// ;
|
||||
// }
|
||||
// @Test public void Thumb_height_no_resize() {
|
||||
// tstr.Lnki_("[[File:A.png|thumb|x100px]]").Src_xfer_("200,100", "mem/wiki/c0/7/70/A.png")
|
||||
// .Expd_xfer_fail_()
|
||||
// .Expd_xfer_pass_("mem/xowa/raw/7/0/A.png/200_100.png")
|
||||
// .Expd_html_src_("file:///mem/xowa/raw/7/0/A.png/200_100.png")
|
||||
// .Expd_fit_reg_
|
||||
// ( "-1,-1|0|200,100"
|
||||
// , "-1,100|0|200,100"
|
||||
// )
|
||||
// .tst()
|
||||
// ;
|
||||
// }
|
||||
// @Test public void Thumb_width_basic() {
|
||||
// tstr.Lnki_("[[File:A.png|thumb|100px]]").Src_xfer_("100,50", "mem/wiki/c0/thumb/7/70/A.png/100px-A.png")
|
||||
// .Expd_xfer_fail_()
|
||||
// .Expd_xfer_pass_("mem/xowa/fit/7/0/A.png/100_50.png")
|
||||
// .Expd_html_src_("file:///mem/xowa/fit/7/0/A.png/100_50.png")
|
||||
// .Expd_fit_reg_
|
||||
// ( "100,-1|1|100,50"
|
||||
// )
|
||||
// .tst()
|
||||
// ;
|
||||
// }
|
||||
// @Test public void Thumb_resize_width_too_long() { // lnki width > raw; just use raw // WP.EX:[[File:Adhanema Lasva.jpg|thumb|300px|The Firman given to the Bosnian Franciscans]]; src=149,408
|
||||
// tstr.Lnki_("[[File:A.png|thumb|200px]]").Src_xfer_("100,50", "mem/wiki/c0/7/70/A.png")
|
||||
// .Expd_xfer_fail_
|
||||
// ( "mem/wiki/c0/thumb/7/70/A.png/200px-A.png"
|
||||
// , "mem/wiki/en/thumb/7/70/A.png/200px-A.png")
|
||||
// .Expd_xfer_pass_
|
||||
// ( "mem/xowa/raw/7/0/A.png/100_50.png"
|
||||
// )
|
||||
// .Expd_html_src_("file:///mem/xowa/raw/7/0/A.png/100_50.png")
|
||||
// .Expd_fit_reg_
|
||||
// ( "-1,-1|0|100,50"
|
||||
// , "200,-1|0|100,50"
|
||||
// )
|
||||
// .tst()
|
||||
// ;
|
||||
// }
|
||||
// @Test public void Thumb_resize_width_is_wrong() { // size does not match scaling; recalc; // WP.EX:[[File:Firma B.Ohiggins.svg|128x80px|alt=|Bernardo O'Higgins's signature]]; src=720,196
|
||||
// tstr.Lnki_("[[File:A.png|thumb|128x80px]]").Src_xfer_("720,196", "mem/wiki/c0/7/70/A.png")
|
||||
// .Expd_xfer_fail_()
|
||||
// .Expd_xfer_pass_("mem/xowa/raw/7/0/A.png/720_196.png", "mem/xowa/fit/7/0/A.png/128_34.png")
|
||||
// .Expd_html_src_("file:///mem/xowa/fit/7/0/A.png/128_34.png")
|
||||
// .Expd_fit_reg_
|
||||
// ( "-1,-1|0|720,196"
|
||||
// , "128,80|1|128,34"
|
||||
// )
|
||||
// .tst()
|
||||
// ;
|
||||
// }
|
||||
// @Test public void Svg_height() {
|
||||
// tstr.Lnki_("[[File:A.svg|x20px]]")
|
||||
// .Src_xfer_(tstr.file_svg(80, 100) , "mem/wiki/c0/7/75/A.svg")
|
||||
// .Expd_xfer_fail_()
|
||||
// .Expd_xfer_pass_
|
||||
// ( "mem/xowa/raw/7/5/A.svg/80_100.svg"
|
||||
// , "mem/xowa/fit/7/5/A.svg/16_20.png"
|
||||
// )
|
||||
// .Expd_html_src_("file:///mem/xowa/fit/7/5/A.svg/16_20.png")
|
||||
// .Expd_fit_reg_
|
||||
// ( "-1,20|1|16,20"
|
||||
// )
|
||||
// .tst()
|
||||
// ;
|
||||
// }
|
||||
// @Test public void Svg_height_overrides_width() {
|
||||
// tstr.Lnki_("[[File:A.svg|20x20px]]")
|
||||
// .Src_xfer_(tstr.file_svg(80, 100) , "mem/wiki/c0/7/75/A.svg")
|
||||
// .Expd_xfer_fail_()
|
||||
// .Expd_xfer_pass_
|
||||
// ( "mem/xowa/raw/7/5/A.svg/80_100.svg"
|
||||
// , "mem/xowa/fit/7/5/A.svg/16_20.png"
|
||||
// )
|
||||
// .Expd_html_src_("file:///mem/xowa/fit/7/5/A.svg/16_20.png")
|
||||
// .Expd_fit_reg_
|
||||
// ( "20,20|1|16,20"
|
||||
// )
|
||||
// .tst()
|
||||
// ;
|
||||
// }
|
||||
// @Test public void Svg_resize_width_too_long() {
|
||||
// tstr.Lnki_("[[File:A.svg|50x40px]]")
|
||||
// .Src_xfer_(tstr.file_svg(40, 40) , "mem/wiki/c0/7/75/A.svg")
|
||||
// .Expd_xfer_pass_
|
||||
// ( "mem/xowa/raw/7/5/A.svg/40_40.svg"
|
||||
// , "mem/xowa/fit/7/5/A.svg/40_40.png")
|
||||
// .Expd_html_src_("file:///mem/xowa/fit/7/5/A.svg/40_40.png")
|
||||
// .Expd_fit_reg_
|
||||
// ( "50,40|1|40,40"
|
||||
// )
|
||||
// .tst()
|
||||
// ;
|
||||
// }
|
||||
//*/
|
||||
@@ -43,7 +43,7 @@ public class Xof_xfer_queue_html_fxt extends Xof_xfer_queue_base_fxt {
|
||||
this.Api_size().Ini(wiki_key, ttl_str, redirect_str, orig_w, orig_h, pass);
|
||||
return this;
|
||||
}
|
||||
public void tst() {
|
||||
@gplx.Virtual public void tst() {
|
||||
Xow_wiki wiki = this.En_wiki();
|
||||
ini_src_fils();
|
||||
wiki.App().File_mgr().Download_mgr().Enabled_(true);
|
||||
|
||||
@@ -65,7 +65,7 @@ public class Xow_repo_mgr implements GfoInvkAble {
|
||||
xfer_itm.Trg_repo_idx_(meta_itm.Vrtl_repo()); // NOTE: set trg_repo_idx b/c xfer_mgr will always set meta_itm.Vrtl_repo() with trg_repo_idx
|
||||
}
|
||||
if (meta_itm.Ptr_ttl_exists())
|
||||
xfer_itm.Atrs_by_ttl(meta_itm.Ttl(), meta_itm.Ptr_ttl());
|
||||
xfer_itm.Set__ttl(meta_itm.Ttl(), meta_itm.Ptr_ttl());
|
||||
boolean main_exists_unknown = src_wiki_key == null; // WORKAROUND/HACK: SEE:NOTE_1:reset_main_exists
|
||||
boolean rv = Xfer_by_meta__exec(chk_all, xfer_itm, meta_itm, src_wiki_key, queue, false);
|
||||
if (!rv && (!chk_all && !main_exists_unknown)) { // xfer failed even with page found in wiki; try again, but chk all
|
||||
|
||||
Reference in New Issue
Block a user