mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.8.5.1
This commit is contained in:
@@ -67,7 +67,7 @@ public class Xof_img_size_tst {
|
||||
fxt.Lnki_ext_(Xof_ext_.Id_svg).Lnki_(-1, 40).Orig_(1, 1).Test_html(40, 40, Bool_.N); // NOTE: used to be 1,1
|
||||
}
|
||||
@Test public void Svg_max_width() { // PURPOSE: large width causes int overflow; vi.w:Danh_sách_quốc_kỳ DATE:2014-04-26
|
||||
fxt.Lnki_ext_(Xof_ext_.Id_svg).Lnki_(Int_.MaxValue, 90).Orig_(900, 600).Test_html(135, 90, Bool_.N); // NOTE: used to be Int_.MaxValue,90
|
||||
fxt.Lnki_ext_(Xof_ext_.Id_svg).Lnki_(Int_.Max_value, 90).Orig_(900, 600).Test_html(135, 90, Bool_.N); // NOTE: used to be Int_.Max_value,90
|
||||
}
|
||||
@Test public void Pdf_none_defaults_to_thumb() { // PURPOSE: if no width is specified, pdf uses thumb width default, not orig width); DATE: 2013-11-27
|
||||
fxt.Lnki_type_(Xop_lnki_type.Id_none).Lnki_ext_(Xof_ext_.Id_pdf).Lnki_(-1, -1).Orig_(440, 220).Test_html(220, 110, Bool_.N); // NOTE: used to be 1,1
|
||||
|
||||
@@ -31,9 +31,9 @@ public class Xof_xfer_itm_tst {
|
||||
@Test public void Explicit_ratio_small() {tst_Calc_view("120,80" , "200,100" , "120,60");} // see NOTE_1:view ratio > file ratio
|
||||
private void tst_Calc_view(String lnki_str, String file_str, String expd_str) {
|
||||
Int_2_ref rv = new Int_2_ref();
|
||||
Int_2_val lnki = Int_2_val.parse_(lnki_str);
|
||||
Int_2_val file = Int_2_val.parse_(file_str);
|
||||
Int_2_val expd = Int_2_val.parse_(expd_str);
|
||||
Int_2_val lnki = Int_2_val.parse(lnki_str);
|
||||
Int_2_val file = Int_2_val.parse(file_str);
|
||||
Int_2_val expd = Int_2_val.parse(expd_str);
|
||||
Xof_xfer_itm_.Calc_view(rv, Xop_lnki_type.Id_thumb, lnki.Val_0(), lnki.Val_1(), file.Val_0(), file.Val_1(), true);
|
||||
Tfds.Eq(expd.Val_0(), rv.Val_0());
|
||||
Tfds.Eq(expd.Val_1(), rv.Val_1());
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Xof_bin_wkr__fsdb_sql implements Xof_bin_wkr {
|
||||
}
|
||||
public Io_stream_rdr Get_to_fsys_near(Xof_fsdb_itm rv, byte[] orig_repo, byte[] orig_ttl, Xof_ext orig_ext, double lnki_time, int lnki_page) {
|
||||
Fsd_thm_itm thm_itm = Fsd_thm_itm.new_();
|
||||
thm_itm.Init_by_req(Int_.MaxValue, lnki_time, lnki_page);
|
||||
thm_itm.Init_by_req(Int_.Max_value, lnki_time, lnki_page);
|
||||
boolean found = Select_thm_bin(Bool_.N, thm_itm, orig_repo, orig_ttl);
|
||||
if (found) {
|
||||
tmp_ids.Init_by_thm(found, thm_itm);
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Xou_cache_mgr {
|
||||
public long Fsys_size_min() {return fsys_size_min;} public void Fsys_size_min_(long v) {fsys_size_min = v;} private long fsys_size_min = Io_mgr.Len_mb * 75;
|
||||
public long Fsys_size_max() {return fsys_size_max;} public void Fsys_size_max_(long v) {fsys_size_max = v;} private long fsys_size_max = Io_mgr.Len_mb * 100;
|
||||
public KeyVal[] Info() {
|
||||
long view_date = Long_.MaxValue;
|
||||
long view_date = Long_.Max_value;
|
||||
long fsys_size = 0;
|
||||
int len = hash.Count();
|
||||
for (int i = 0; i < len; ++i) {
|
||||
@@ -45,7 +45,7 @@ public class Xou_cache_mgr {
|
||||
( KeyVal_.new_("cache folder", cache_dir.Xto_api())
|
||||
, KeyVal_.new_("space used", gplx.ios.Io_size_.To_str(fsys_size))
|
||||
, KeyVal_.new_("file count", len)
|
||||
, KeyVal_.new_("oldest file", view_date == Long_.MaxValue ? "" : DateAdp_.unixtime_utc_seconds_(view_date).XtoStr_fmt_iso_8561())
|
||||
, KeyVal_.new_("oldest file", view_date == Long_.Max_value ? "" : DateAdp_.unixtime_utc_seconds_(view_date).XtoStr_fmt_iso_8561())
|
||||
);
|
||||
}
|
||||
public Xou_cache_itm Get_or_null(Xof_fsdb_itm fsdb) {return Get_or_null(fsdb.Lnki_wiki_abrv(), fsdb.Lnki_ttl(), fsdb.Lnki_type(), fsdb.Lnki_upright(), fsdb.Lnki_w(), fsdb.Lnki_h(), fsdb.Lnki_time(), fsdb.Lnki_page(), fsdb.User_thumb_w());}
|
||||
|
||||
@@ -66,7 +66,7 @@ class Xof_file_fxt {
|
||||
itm.Init_at_lnki(arg.Exec_tid(), wiki.Domain_itm().Abrv_xo(), ttl_bry, arg.Lnki_type(), arg.Lnki_upright(), arg.Lnki_w(), arg.Lnki_h(), arg.Lnki_time(), Xof_lnki_page.Null, Xof_patch_upright_tid_.Tid_all);
|
||||
List_adp itms_list = List_adp_.new_(); itms_list.Add(itm);
|
||||
orig_mgr.Find_by_list(Ordered_hash_.new_bry_(), itms_list, Xof_exec_tid.Tid_wiki_page);
|
||||
Xoa_ttl ttl = Xoa_ttl.parse_(wiki, Xow_ns_.Id_main, ttl_bry);
|
||||
Xoa_ttl ttl = Xoa_ttl.parse(wiki, Xow_ns_.Id_main, ttl_bry);
|
||||
Xoae_page page = Xoae_page.new_(wiki, ttl);
|
||||
fsdb_mgr.Fsdb_search_by_list(itms_list, wiki, page, Xog_js_wkr_.Noop);
|
||||
if (arg.Rslt_orig_exists() != Bool_.__byte) Tfds.Eq(arg.Rslt_orig_exists() == Bool_.Y_byte, itm.Orig_exists(), "orig_exists");
|
||||
|
||||
@@ -31,7 +31,7 @@ class Xof_img_wkr_query_img_size_imageMagick implements Xof_img_wkr_query_img_si
|
||||
int pos_bgn = String_.FindFwd(size_str, "<{", 0); if (pos_bgn == String_.Find_none) return SizeAdp_.Zero; // NOTE: RE: "FindFwd(,0)"; multiple frames are possible; 1st frame must be used as last frame is not accurate; EX:w.Chess:[[File:ChessCastlingMovie.gif|thumb|250px]]
|
||||
int pos_end = String_.FindFwd(size_str, "}>", pos_bgn); if (pos_end == String_.Find_none) return SizeAdp_.Zero;
|
||||
size_str = String_.Mid(size_str, pos_bgn + Marker_bgn_len, pos_end);
|
||||
return SizeAdp_.parse_or_(size_str, SizeAdp_.Zero);
|
||||
return SizeAdp_.parse_or(size_str, SizeAdp_.Zero);
|
||||
}
|
||||
static final String Marker_bgn = "<{", Marker_end = "}>"; static final int Marker_bgn_len = String_.Len(Marker_bgn);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ class Xof_wiki_finder { // UNUSED
|
||||
return rv;
|
||||
}
|
||||
private Xoae_page Get_page__by_wiki(Xowe_wiki wiki, int ns_id, byte[] ttl_bry) {
|
||||
Xoa_ttl ttl = Xoa_ttl.parse_(wiki, ns_id, ttl_bry) ;
|
||||
Xoa_ttl ttl = Xoa_ttl.parse(wiki, ns_id, ttl_bry) ;
|
||||
Xoa_url url = Xoa_url.new_(wiki.Domain_bry(), ttl_bry);
|
||||
return wiki.Load_page_by_ttl(url, ttl);
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ public class Xof_xfer_queue_base_fxt {
|
||||
public void ini_page_create_en_wiki(String ttl) {Init_page_create(en_wiki, ttl, "");}
|
||||
public void ini_page_create_en_wiki_redirect(String ttl, String redirect) {Init_page_create(en_wiki, ttl, "#REDIRECT [[" + redirect + "]]");}
|
||||
public void Init_page_create(Xowe_wiki wiki, String ttl, String txt) {
|
||||
Xoa_ttl page_ttl = Xoa_ttl.parse_(wiki, Bry_.new_u8(ttl));
|
||||
Xoa_ttl page_ttl = Xoa_ttl.parse(wiki, Bry_.new_u8(ttl));
|
||||
byte[] page_raw = Bry_.new_u8(txt);
|
||||
wiki.Db_mgr().Save_mgr().Data_create(page_ttl, page_raw);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user