mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Embeddable: Create core dbs in proper subdirectory
This commit is contained in:
@@ -13,3 +13,15 @@ The terms of each license can be found in the source code repository:
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.files.imgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.xowa.apps.progs.*; import gplx.xowa.bldrs.wms.*; import gplx.xowa.files.cnvs.*;
|
||||
public class Xof_img_mgr {
|
||||
public Xof_img_wkr_resize_img Wkr_resize_img() {return wkr_resize_img;} public void Wkr_resize_img_(Xof_img_wkr_resize_img v) {wkr_resize_img = v;} private Xof_img_wkr_resize_img wkr_resize_img;
|
||||
public Xof_img_wkr_query_img_size Wkr_query_img_size() {return wkr_query_img_size;} public void Wkr_query_img_size_(Xof_img_wkr_query_img_size v) {wkr_query_img_size = v;} private Xof_img_wkr_query_img_size wkr_query_img_size;
|
||||
public Xof_img_wkr_convert_djvu_to_tiff Wkr_convert_djvu_to_tiff() {return wkr_convert_djvu_to_tiff;} public Xof_img_mgr Wkr_convert_djvu_to_tiff_(Xof_img_wkr_convert_djvu_to_tiff v) {wkr_convert_djvu_to_tiff = v; return this;} private Xof_img_wkr_convert_djvu_to_tiff wkr_convert_djvu_to_tiff;
|
||||
public void Init_by_app(Xowmf_mgr wmf_mgr, Xoa_prog_mgr prog_mgr) {
|
||||
wkr_resize_img = new Xof_img_wkr_resize_img_imageMagick(wmf_mgr, prog_mgr.App_resize_img(), prog_mgr.App_convert_svg_to_png());
|
||||
wkr_query_img_size = new Xof_img_wkr_query_img_size_imageMagick(wmf_mgr, prog_mgr.App_query_img_size());
|
||||
wkr_convert_djvu_to_tiff = new Xof_img_wkr_convert_djvu_to_tiff_app(prog_mgr.App_convert_djvu_to_tiff());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,3 +13,12 @@ The terms of each license can be found in the source code repository:
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.files.imgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
public class Xof_img_mode_ {
|
||||
public static final byte
|
||||
Tid__orig = 0
|
||||
, Tid__thumb = 1
|
||||
;
|
||||
public static byte By_bool(boolean is_thumb) {return is_thumb ? Tid__thumb : Tid__orig;}
|
||||
public static final byte[][] Names_ary = new byte[][] {Bry_.new_a7("orig"), Bry_.new_a7("thumb")};
|
||||
}
|
||||
|
||||
@@ -13,3 +13,7 @@ The terms of each license can be found in the source code repository:
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.files.imgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
public interface Xof_img_wkr_convert_djvu_to_tiff {
|
||||
boolean Exec(Io_url src, Io_url trg);
|
||||
}
|
||||
|
||||
@@ -13,3 +13,23 @@ The terms of each license can be found in the source code repository:
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.files.imgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.core.envs.*;
|
||||
public class Xof_img_wkr_convert_djvu_to_tiff_ {
|
||||
public static Xof_img_wkr_convert_djvu_to_tiff new_app(Process_adp process) {return new Xof_img_wkr_convert_djvu_to_tiff_app(process);}
|
||||
public static Xof_img_wkr_convert_djvu_to_tiff new_mok(int w, int h) {return new Xof_img_wkr_convert_djvu_to_tiff_mok(w, h);}
|
||||
}
|
||||
class Xof_img_wkr_convert_djvu_to_tiff_app implements Xof_img_wkr_convert_djvu_to_tiff {
|
||||
public Xof_img_wkr_convert_djvu_to_tiff_app(Process_adp process) {this.process = process;} Process_adp process;
|
||||
public boolean Exec(Io_url src, Io_url trg) {
|
||||
process.Run(src, trg);
|
||||
return process.Exit_code_pass();
|
||||
}
|
||||
}
|
||||
class Xof_img_wkr_convert_djvu_to_tiff_mok implements Xof_img_wkr_convert_djvu_to_tiff {
|
||||
public Xof_img_wkr_convert_djvu_to_tiff_mok(int w, int h) {this.w = w; this.h = h;} private int w, h;
|
||||
public boolean Exec(Io_url src, Io_url trg) {
|
||||
Io_mgr.Instance.SaveFilStr(trg, gplx.gfui.SizeAdp_.new_(w, h).To_str());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,3 +13,24 @@ The terms of each license can be found in the source code repository:
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.files.imgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.core.envs.*;
|
||||
import gplx.gfui.*;
|
||||
import gplx.xowa.bldrs.wms.*;
|
||||
public interface Xof_img_wkr_query_img_size {
|
||||
SizeAdp Exec(Io_url url);
|
||||
}
|
||||
class Xof_img_wkr_query_img_size_imageMagick implements Xof_img_wkr_query_img_size {
|
||||
private final Xowmf_mgr wmf_mgr; private final Process_adp cmd;
|
||||
public Xof_img_wkr_query_img_size_imageMagick(Xowmf_mgr wmf_mgr, Process_adp cmd) {this.wmf_mgr = wmf_mgr; this.cmd = cmd;}
|
||||
public SizeAdp Exec(Io_url url) {
|
||||
cmd.Prog_fmt_(String_.Replace(wmf_mgr.Download_wkr().Download_xrg().Prog_fmt_hdr(), "~", "~~") + " querying: ~{process_seconds} second(s); ~{process_exe_name} ~{process_exe_args}");
|
||||
cmd.Run(url);
|
||||
String size_str = cmd.Rslt_out();
|
||||
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);
|
||||
}
|
||||
static final String Marker_bgn = "<{", Marker_end = "}>"; static final int Marker_bgn_len = String_.Len(Marker_bgn);
|
||||
}
|
||||
|
||||
@@ -13,3 +13,11 @@ The terms of each license can be found in the source code repository:
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.xowa.files.imgs; import gplx.*; import gplx.xowa.*; import gplx.xowa.files.*;
|
||||
import gplx.gfui.*; import gplx.gfui.imgs.*;
|
||||
public class Xof_img_wkr_query_img_size_test implements Xof_img_wkr_query_img_size {
|
||||
public SizeAdp Exec(Io_url url) {
|
||||
ImageAdp image = ImageAdp_.txt_fil_(url);
|
||||
return image.Size();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user