private void Download_exec(Xodb_tbl_oimg_xfer_itm fsdb) { Io_stream_rdr src_rdr = src_bin_mgr.Find_as_rdr(Xof_exec_tid.Tid_wiki_page, fsdb); try { if (src_rdr == Io_stream_rdr_.Noop) { // download failed ++exec_fail; usr_dlg.Warn_many( "", "", "failed: ttl=~{0}", String_.Format("[[File:{0}|{1}px]]", fsdb.Orig_ttl(), fsdb.Html_w())); Print_progress(fsdb); } else { // download passed long src_rdr_len = src_rdr.Len(); int lnki_tier_id = fsdb.Lnki_tier_id(); if (src_rdr_len > download_size_max && !Int_.In(lnki_tier_id, download_keep_tier_ids)) { usr_dlg.Warn_many( "", "", "skipped; ttl=~{0} w=~{1} size=~{2} tier=~{3}", fsdb.Orig_ttl(), fsdb.Lnki_w(), src_rdr_len, lnki_tier_id); return; } if (trg_bin_fil == null) // no trg_bin_fil Make_trg_bin_file(Bool_.Y, fsdb, src_rdr_len); else if (trg_bin_fil.Bin_len() + src_rdr_len > trg_bin_db_max) // or trg_bin_fil is out of space Make_trg_bin_file(Bool_.N, fsdb, src_rdr_len); else if (prv_lnki_tier_id != lnki_tier_id) { // or tier has changed if (prv_lnki_tier_id != -1 && !bin_db_mgr.Schema_is_1()) // do not increment dbs for v1 Make_trg_bin_file(Bool_.Y, fsdb, src_rdr_len); prv_lnki_tier_id = lnki_tier_id; } trg_bin_updater.Save_bin(trg_mnt_itm, trg_atr_fil, trg_bin_fil, fsdb, src_rdr, src_rdr_len); } } finally { src_rdr.Rls(); } }
String file_svg(int w, int h) {return String_.Format("<svg width=\"{0}\" height=\"{1}\" />", w, h);}
String file_img(int w, int h) {return String_.Format("{0},{1}", w, h);}