1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2014-08-10 23:10:23 -04:00
parent fb8c06c560
commit 67b04263a7
131 changed files with 2285 additions and 1355 deletions

View File

@@ -43,9 +43,11 @@ public class Xof_xfer_mgr {
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;
public boolean Make_file(Xow_wiki wiki) {
rslt.Clear(); this.wiki = wiki;
if ( ext.Id() == Xof_ext_.Id_ogg // file is ogg; could be audio; DATE:2013-08-03
&& !meta_itm.Thumbs_indicates_oga() // check to make sure it hasn't been called before
&& src_repo.Wmf_api() // make sure wmf_api enabled
if ( src_repo.Wmf_api() // make sure wmf_api enabled
&& ( ( ext.Id() == Xof_ext_.Id_ogg // file is ogg; could be audio; DATE:2013-08-03
&& !meta_itm.Thumbs_indicates_oga()) // check to make sure it hasn't been called before
|| xfer_itm.Html_elem_tid() == Xof_html_elem.Tid_imap // file is imap
)
)
Call_wmf_api();
if (ext.Id_is_thumbable_img()) Make_img();

View File

@@ -31,6 +31,7 @@ public class Xof_xfer_queue_html_fxt extends Xof_xfer_queue_base_fxt {
return this;
} private Xof_xfer_itm xfer_itm = new Xof_xfer_itm(); Bool_obj_ref queue_add_ref = Bool_obj_ref.n_();
Xof_xfer_queue queue = new Xof_xfer_queue();
public Xof_xfer_itm Xfer_itm() {return xfer_itm;}
public Xof_xfer_queue_html_fxt Src(Io_fil... v) {return (Xof_xfer_queue_html_fxt)Src_base(v);}
public Xof_xfer_queue_html_fxt Trg(Io_fil... v) {return (Xof_xfer_queue_html_fxt)Trg_base(v);}
public Xof_xfer_queue_html_fxt Html_src_(String v) {return (Xof_xfer_queue_html_fxt)Html_src_base_(v);}

View File

@@ -156,5 +156,16 @@ public class Xof_xfer_queue_html_wmf_api_tst {
.Html_size_(85, 120)
.tst();
}
@Test public void Imap() { // PURPOSE: check that imap downloads orig, even when thumb is requested; DATE:2014-08-08
fxt .ini_page_create_commons("File:A.png");
fxt .ini_page_api("commons", "A.png", "", 180, 160);
fxt .Lnki_("A.png", true, 90, Xof_img_size.Size_null_deprecated, Xof_img_size.Size_null_deprecated, Xof_doc_thumb.Null_as_int); // thumbtime of 2 specified; will be ignored below
fxt .Xfer_itm().Html_elem_tid_(Xof_html_elem.Tid_imap);
fxt .Src( fxt.img_("mem/src/commons.wikimedia.org/thumb/7/70/A.png/90px-A.png", 90, 80))
.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?180,160|1?90,80") // check that orig has 180,160, not 0,0
);
fxt.tst();
}
}
// Tfds.Write_bry(Xof_xfer_itm_.Md5_calc(Bry_.new_ascii_("A~.png")));