WikipediaをEPWING形式に変換する(Cygwin環境作成ーWindows10版)

サイトを移行する事になり、それに合わせて久しぶりにEPWINGの変換でもと思って環境を引っ張り出してきたんですが。。引っ張り出してきた環境はVista、当然のことながら色々と無理だったので環境を作り直す事になりました。

Cygwinは64bit版をインストール、必要なパッケージは少し変わっていました。

「Base」「Devel」「Perl」「Archive」「lib」のインストールに加えて以下のパッケージを個別インストール

・Graphics/GraphicsMagick
・Graphics/ImageMagick
・Graphics/libMagick-devel
・Graphics/perl-Image-Magick(+src)

結構重要なのですが、Perl 5.26以降では@INCからカレントディレクトリが削除されてしまっています。このままだと上手く変換スプリクトが動作しなくなっているので少し環境変数をいじる必要があります。

Cygwinでの変換実行ユーザーで[.bash_profile]に以下の設定を追加

export PERL_USE_UNSAFE_INC=1

オプションの画像

◆PerlMagickのインストール

$ cp -p /usr/src/ImageMagick-7.0.xx-xx.src .
$ tar xvf ./ImageMagick-7.0.xx-xx.tar.lz
$ cd ./ImageMagick-7.0.xx-xx
$ ./configure --with-quantum-depth=16 --with-perl=/path/to/bin/perl
$ make perl-sources
$ cd ./PerlMagick/
$ perl Makefile.PL
$ make
$ make install

◆mimeTeXのインストール

unzip mimetex.zip 
gcc -DAA -DAA mimetex.c gifsave.c -lm -o mimetex.exe
cp -p ./mimetex.exe /usr/local/bin/

パッケージのインストール確認

$ perl -V
Summary of my perl5 (revision 5 version 32 subversion 1) configuration:

  Platform:
    osname=cygwin
    osvers=3.2.0(0.34053)
    archname=x86_64-cygwin-threads-multi
    uname='cygwin_nt-10.0 cygwinpro 3.2.0(0.34053) 2021-03-29 08:42 x86_64 cygwin '
    config_args='-des -Dprefix=/usr -Dmksymlinks -Darchname=x86_64-cygwin-threads -Dlibperl=cygperl5_32.dll -Dcc=gcc -Dld=g++ -Accflags=-ggdb -O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/build=/usr/src/debug/perl-5.32.1-2 -fdebug-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/src/perl-5.32.1=/usr/src/debug/perl-5.32.1-2 -fwrapv'
    hint=recommended
    useposix=true
    d_sigaction=define
    useithreads=define
    usemultiplicity=define
    use64bitint=define
    use64bitall=define
    uselongdouble=undef
    usemymalloc=n
    default_inc_excludes_dot=define
    bincompat5005=undef
  Compiler:
    cc='gcc'
    ccflags ='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -ggdb -O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/build=/usr/src/debug/perl-5.32.1-2 -fdebug-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/src/perl-5.32.1=/usr/src/debug/perl-5.32.1-2 -fwrapv -fno-strict-aliasing'
    optimize='-O3'
    cppflags='-DPERL_USE_SAFE_PUTENV -U__STRICT_ANSI__ -D_GNU_SOURCE -ggdb -O2 -pipe -Wall -Werror=format-security -D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -fdebug-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/build=/usr/src/debug/perl-5.32.1-2 -fdebug-prefix-map=/mnt/share/cygpkgs/perl/perl.x86_64/src/perl-5.32.1=/usr/src/debug/perl-5.32.1-2 -fwrapv -fno-strict-aliasing'
    ccversion=''
    gccversion='10.2.0'
    gccosandvers=''
    intsize=4
    longsize=8
    ptrsize=8
    doublesize=8
    byteorder=12345678
    doublekind=3
    d_longlong=define
    longlongsize=8
    d_longdbl=define
    longdblsize=16
    longdblkind=3
    ivtype='long'
    ivsize=8
    nvtype='double'
    nvsize=8
    Off_t='off_t'
    lseeksize=8
    alignbytes=8
    prototype=define
  Linker and Libraries:
    ld='g++'
    ldflags =' -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong'
    libpth=/usr/lib
    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lcrypt -lgdbm_compat
    perllibs=-lpthread -lnsl -ldl -lcrypt
    libc=/usr/lib/libcygwin.a
    so=dll
    useshrplib=true
    libperl=cygperl5_32.dll
    gnulibc_version=''
  Dynamic Linking:
    dlsrc=dl_dlopen.xs
    dlext=dll
    d_dlsymun=undef
    ccdlflags=' '
    cccdlflags=' '
    lddlflags=' --shared  -Wl,--enable-auto-import -Wl,--export-all-symbols -Wl,--enable-auto-image-base -fstack-protector-strong'


Characteristics of this binary (from libperl):
  Compile-time options:
    HAS_TIMES
    MULTIPLICITY
    PERLIO_LAYERS
    PERL_COPY_ON_WRITE
    PERL_DONT_CREATE_GVSV
    PERL_IMPLICIT_CONTEXT
    PERL_OP_PARENT
    PERL_PRESERVE_IVUV
    PERL_USE_SAFE_PUTENV
    USE_64_BIT_ALL
    USE_64_BIT_INT
    USE_ITHREADS
    USE_LARGE_FILES
    USE_LOCALE
    USE_LOCALE_COLLATE
    USE_LOCALE_CTYPE
    USE_LOCALE_NUMERIC
    USE_LOCALE_TIME
    USE_PERLIO
    USE_PERL_ATOF
    USE_REENTRANT_API
    USE_THREAD_SAFE_LOCALE
  Locally applied patches:
    Cygwin: README
    Cygwin: use auto-image-base instead of fixed DLL base address
    Cygwin: modify hints
    Cygwin: Configure correct libsearch
    Cygwin: Configure correct libpth
    Cygwin: Encode fix for CVE-2021-36770
    Cygwin: Win32 correct UTF8 handling
  Built under cygwin
  Compiled at Aug 14 2021 09:07:12
  %ENV:
    PERL_USE_UNSAFE_INC="1"
    CYGWIN="ntsec"
  @INC:
    /usr/local/lib/perl5/site_perl/5.32/x86_64-cygwin-threads
    /usr/local/share/perl5/site_perl/5.32
    /usr/lib/perl5/vendor_perl/5.32/x86_64-cygwin-threads
    /usr/share/perl5/vendor_perl/5.32
    /usr/lib/perl5/5.32/x86_64-cygwin-threads
    /usr/share/perl5/5.32
    .
$ convert -list format
   Format  Mode  Description
-------------------------------------------------------------------------------
      3FR  r--   Hasselblad CFV/H3D39II
      3G2  r--   Media Container
      3GP  r--   Media Container
        A* rw+   Raw alpha samples
      AAI* rw+   AAI Dune image
       AI  rw-   Adobe Illustrator CS2
     APNG  rw+   Animated Portable Network Graphics
      ART* rw-   PFS: 1st Publisher Clip Art
      ARW  r--   Sony Alpha Raw Image Format
   ASHLAR* -w+   Image sequence laid out in continuous irregular courses
      AVI  r--   Microsoft Audio/Visual Interleaved
     AVIF* ---   AV1 Image File Format (1.12.0)
      AVS* rw+   AVS X image
        B* rw+   Raw blue samples
      BGR* rw+   Raw blue, green, and red samples
     BGRA* rw+   Raw blue, green, red, and alpha samples
     BGRO* rw+   Raw blue, green, red, and opacity samples
      BIE* rw-   Joint Bi-level Image experts Group interchange format (2.1)
      BMP* rw-   Microsoft Windows bitmap image
     BMP2* rw-   Microsoft Windows bitmap image (V2)
     BMP3* rw-   Microsoft Windows bitmap image (V3)
      BRF* -w-   BRF ASCII Braille format
        C* rw+   Raw cyan samples
      CAL* rw-   Continuous Acquisition and Life-cycle Support Type 1
           Specified in MIL-R-28002 and MIL-PRF-28002
     CALS* rw-   Continuous Acquisition and Life-cycle Support Type 1
           Specified in MIL-R-28002 and MIL-PRF-28002
   CANVAS* r--   Constant image uniform color
  CAPTION* r--   Caption
      CIN* rw-   Cineon Image File
      CIP* -w-   Cisco IP phone image format
     CLIP* rw+   Image Clip Mask
CLIPBOARD* rw-   The system clipboard
     CMYK* rw+   Raw cyan, magenta, yellow, and black samples
    CMYKA* rw+   Raw cyan, magenta, yellow, black, and alpha samples
      CR2  r--   Canon Digital Camera Raw Image Format
      CR3  r--   Canon Digital Camera Raw Image Format
      CRW  r--   Canon Digital Camera Raw Image Format
     CUBE* r--   Cube LUT
      CUR* rw-   Microsoft icon
      CUT* r--   DR Halo
     DATA* rw+   Base64-encoded inline images
      DCM* r--   Digital Imaging and Communications in Medicine image
           DICOM is used by the medical community for images like X-rays.  The
           specification, "Digital Imaging and Communications in Medicine
           (DICOM)", is available at http://medical.nema.org/.  In particular,
           see part 5 which describes the image encoding (RLE, JPEG, JPEG-LS),
           and supplement 61 which adds JPEG-2000 encoding.
      DCR  r--   Kodak Digital Camera Raw Image File
    DCRAW  r--   Raw Photo Decoder (dcraw)
      DCX* rw+   ZSoft IBM PC multi-page Paintbrush
      DDS* rw+   Microsoft DirectDraw Surface
    DFONT* r--   Multi-face font package (Freetype 2.13.0)
     DJVU* r--   Deja vu
           See http://www.djvuzone.org/ for details about the DJVU format.  The
           DJVU 1.2 specification is available there and at
           ftp://swrinde.nde.swri.edu/pub/djvu/documents/.
      DNG  r--   Digital Negative
      DOT  r--   Graphviz
      DPX* rw-   SMPTE 268M-2003 (DPX 2.0)
           Digital Moving Picture Exchange Bitmap, Version 2.0.
           See SMPTE 268M-2003 specification at http://www.smtpe.org

     DXT1* rw+   Microsoft DirectDraw Surface
     DXT5* rw+   Microsoft DirectDraw Surface
      EMF  r--   Windows Enhanced Meta File
     EPDF  rw-   Encapsulated Portable Document Format
      EPI  rw-   Encapsulated PostScript Interchange format
      EPS  rw-   Encapsulated PostScript
     EPS2  -w-   Level II Encapsulated PostScript
     EPS3  -w+   Level III Encapsulated PostScript
     EPSF  rw-   Encapsulated PostScript
     EPSI  rw-   Encapsulated PostScript Interchange format
      EPT  rw-   Encapsulated PostScript with TIFF preview
     EPT2  rw-   Encapsulated PostScript Level II with TIFF preview
     EPT3  rw+   Encapsulated PostScript Level III with TIFF preview
      ERF  r--   Epson RAW Format
      EXR  rw-   High Dynamic-range (HDR) (OpenEXR 2.5.8)
 FARBFELD* rw-   Farbfeld
      FAX* rw+   Group 3 FAX
           FAX machines use non-square pixels which are 1.5 times wider than
           they are tall but computer displays use square pixels, therefore
           FAX images may appear to be narrow unless they are explicitly
           resized using a geometry of "150x100%".

       FF* rw-   Farbfeld
     FILE* r--   Uniform Resource Locator (file://)
     FITS* rw-   Flexible Image Transport System
     FL32* rw-   FilmLight
      FLV  rw+   Flash Video Stream
      FPX  rw-   FlashPix Format
  FRACTAL* r--   Plasma fractal image
      FTP* r--   Uniform Resource Locator (ftp://)
      FTS* rw-   Flexible Image Transport System
        G* rw+   Raw green samples
       G3* rw-   Group 3 FAX
       G4* rw-   Group 4 FAX
      GIF* rw+   CompuServe graphics interchange format
    GIF87* rw-   CompuServe graphics interchange format (version 87a)
 GRADIENT* r--   Gradual linear passing from one shade to another
     GRAY* rw+   Raw gray samples
    GRAYA* rw+   Raw gray and alpha samples
   GROUP4* rw-   Raw CCITT Group4
       GV  r--   Graphviz
     HALD* r--   Identity Hald color lookup table image
      HDR* rw+   Radiance RGBE image format
     HEIC* r--   High Efficiency Image Format (1.12.0)
     HEIF* r--   High Efficiency Image Format (1.12.0)
HISTOGRAM* -w-   Histogram of the image
      HRZ* rw-   Slow Scan TeleVision
      HTM* -w-   Hypertext Markup Language and a client-side image map
     HTML* -w-   Hypertext Markup Language and a client-side image map
     HTTP* r--   Uniform Resource Locator (http://)
    HTTPS* r--   Uniform Resource Locator (https://)
      ICB* rw-   Truevision Targa image
      ICO* rw+   Microsoft icon
     ICON* rw-   Microsoft icon
      IIQ  r--   Phase One Raw Image Format
     INFO  -w+   The image format and characteristics
   INLINE* rw+   Base64-encoded inline images
      IPL* rw+   IPL Image Sequence
   ISOBRL* -w-   ISO/TR 11548-1 format
  ISOBRL6* -w-   ISO/TR 11548-1 format 6dot
      J2C* rw-   JPEG-2000 Code Stream Syntax (2.5.2)
      J2K* rw-   JPEG-2000 Code Stream Syntax (2.5.2)
      JBG* rw+   Joint Bi-level Image experts Group interchange format (2.1)
     JBIG* rw+   Joint Bi-level Image experts Group interchange format (2.1)
      JNG* rw-   JPEG Network Graphics
           See http://www.libpng.org/pub/mng/ for details about the JNG
           format.
      JNX* r--   Garmin tile format
      JP2* rw-   JPEG-2000 File Format Syntax (2.5.2)
      JPC* rw-   JPEG-2000 Code Stream Syntax (2.5.2)
      JPE* rw-   Joint Photographic Experts Group JFIF format (libjpeg-turbo 2.1.5.1)
     JPEG* rw-   Joint Photographic Experts Group JFIF format (libjpeg-turbo 2.1.5.1)
      JPG* rw-   Joint Photographic Experts Group JFIF format (libjpeg-turbo 2.1.5.1)
      JPM* rw-   JPEG-2000 File Format Syntax (2.5.2)
      JPS* rw-   Joint Photographic Experts Group JFIF format (libjpeg-turbo 2.1.5.1)
      JPT* rw-   JPEG-2000 File Format Syntax (2.5.2)
     JSON  -w+   The image format and characteristics
        K* rw+   Raw black samples
      K25  r--   Kodak Digital Camera Raw Image Format
      KDC  r--   Kodak Digital Camera Raw Image Format
    LABEL* r--   Image label
        M* rw+   Raw magenta samples
      M2V  rw+   MPEG Video Stream
      M4V  rw+   Raw VIDEO-4 Video
      MAC* r--   MAC Paint
      MAP* rw-   Colormap intensities and indices
     MASK* rw+   Image Clip Mask
      MAT  rw+   MATLAB level 5 image format
    MATTE* -w+   MATTE format
      MEF  r--   Mamiya Raw Image File
     MIFF* rw+   Magick Image File Format
      MKV  rw+   Multimedia Container
      MNG* rw+   Multiple-image Network Graphics (libpng 1.6.39,1.6.42)
           See http://www.libpng.org/pub/mng/ for details about the MNG
           format.
     MONO* rw-   Raw bi-level bitmap
      MOV  rw+   MPEG Video Stream
      MP4  rw+   VIDEO-4 Video Stream
      MPC* rw+   Magick Persistent Cache image format
     MPEG  rw+   MPEG Video Stream
      MPG  rw+   MPEG Video Stream
      MRW  r--   Sony (Minolta) Raw Image File
      MSL* rw+   Magick Scripting Language
     MSVG* rw+   ImageMagick's own SVG internal renderer
      MTV* rw+   MTV Raytracing image format
      MVG* rw-   Magick Vector Graphics
      NEF  r--   Nikon Digital SLR Camera Raw Image File
      NRW  r--   Nikon Digital SLR Camera Raw Image File
     NULL* rw-   Constant image of uniform color
        O* rw+   Raw opacity samples
      ORA  ---   OpenRaster format
      ORF  r--   Olympus Digital Camera Raw Image File
      OTB* rw-   On-the-air bitmap
      OTF* r--   Open Type font (Freetype 2.13.0)
      PAL* rw-   16bit/pixel interleaved YUV
     PALM* rw+   Palm pixmap
      PAM* rw+   Common 2-dimensional bitmap format
    PANGO* r--   Pango Markup Language (Pangocairo 1.40.14)
  PATTERN* r--   Predefined pattern
      PBM* rw+   Portable bitmap format (black and white)
      PCD* rw-   Photo CD
     PCDS* rw-   Photo CD
      PCL  rw+   Printer Control Language
      PCT* rw-   Apple Macintosh QuickDraw/PICT
      PCX* rw-   ZSoft IBM PC Paintbrush
      PDB* rw+   Palm Database ImageViewer Format
      PDF  rw+   Portable Document Format
     PDFA  rw+   Portable Document Archive Format
      PEF  r--   Pentax Electronic File
      PES* r--   Embrid Embroidery Format
      PFA* r--   Postscript Type 1 font (ASCII) (Freetype 2.13.0)
      PFB* r--   Postscript Type 1 font (binary) (Freetype 2.13.0)
      PFM* rw+   Portable float format
      PGM* rw+   Portable graymap format (gray scale)
      PGX* rw-   JPEG 2000 uncompressed format
      PHM* rw+   Portable half float format
    PICON* rw-   Personal Icon
     PICT* rw-   Apple Macintosh QuickDraw/PICT
      PIX* r--   Alias/Wavefront RLE image format
    PJPEG* rw-   Joint Photographic Experts Group JFIF format (libjpeg-turbo 2.1.5.1)
   PLASMA* r--   Plasma fractal image
      PNG* rw-   Portable Network Graphics (libpng 1.6.39,1.6.42)
           See http://www.libpng.org/ for details about the PNG format.
    PNG00* rw-   PNG inheriting bit-depth, color-type from original, if possible
    PNG24* rw-   opaque or binary transparent 24-bit RGB (zlib 1.2.13,1.3.1)
    PNG32* rw-   opaque or transparent 32-bit RGBA
    PNG48* rw-   opaque or binary transparent 48-bit RGB
    PNG64* rw-   opaque or transparent 64-bit RGBA
     PNG8* rw-   8-bit indexed with optional binary transparency
      PNM* rw+   Portable anymap
POCKETMOD  rw+   Pocketmod Personal Organizer
      PPM* rw+   Portable pixmap format (color)
       PS  rw+   PostScript
      PS2  -w+   Level II PostScript
      PS3  -w+   Level III PostScript
      PSB* rw+   Adobe Large Document Format
      PSD* rw+   Adobe Photoshop bitmap
     PTIF* rw+   Pyramid encoded TIFF
      PWP* r--   Seattle Film Works
        R* rw+   Raw red samples
RADIAL-GRADIENT* r--   Gradual radial passing from one shade to another
      RAF  r--   Fuji CCD-RAW Graphic File
      RAS* rw+   SUN Rasterfile
      RAW  r--   Raw
      RGB* rw+   Raw red, green, and blue samples
   RGB565* r--   Raw red, green, blue samples in 565 format
     RGBA* rw+   Raw red, green, blue, and alpha samples
     RGBO* rw+   Raw red, green, blue, and opacity samples
      RGF* rw-   LEGO Mindstorms EV3 Robot Graphic Format (black and white)
      RLA* r--   Alias/Wavefront image
      RLE* r--   Utah Run length encoded image
      RMF  r--   Raw Media Format
      RW2  r--   Panasonic Lumix Raw Image
      SCR* r--   ZX-Spectrum SCREEN$
SCREENSHOT* r--   Screen shot
      SCT* r--   Scitex HandShake
      SFW* r--   Seattle Film Works
      SGI* rw+   Irix RGB image
    SHTML* -w-   Hypertext Markup Language and a client-side image map
      SIX* rw-   DEC SIXEL Graphics Format
    SIXEL* rw-   DEC SIXEL Graphics Format
SPARSE-COLOR* -w+   Sparse Color
      SR2  r--   Sony Raw Format 2
      SRF  r--   Sony Raw Format
  STEGANO* r--   Steganographic image
      SUN* rw+   SUN Rasterfile
      SVG* rw+   Scalable Vector Graphics (RSVG 2.40.20)
     SVGZ* rw+   Compressed Scalable Vector Graphics (RSVG 2.40.20)
     TEXT* r--   Text
      TGA* rw-   Truevision Targa image
THUMBNAIL* -w+   EXIF Profile Thumbnail
     TIFF* rw+   Tagged Image File Format (LIBTIFF, Version 4.6.0)
   TIFF64* rw+   Tagged Image File Format (64-bit) (LIBTIFF, Version 4.6.0)
     TILE* r--   Tile image with a texture
      TIM* r--   PSX TIM
      TM2* r--   PS2 TIM2
      TTC* r--   TrueType font collection (Freetype 2.13.0)
      TTF* r--   TrueType font (Freetype 2.13.0)
      TXT* rw+   Text
     UBRL* -w-   Unicode Text format
    UBRL6* -w-   Unicode Text format 6dot
      UIL* -w-   X-Motif UIL table
     UYVY* rw-   16bit/pixel interleaved YUV
      VDA* rw-   Truevision Targa image
    VICAR* rw-   VICAR rasterfile format
      VID* rw+   Visual Image Directory
     VIFF* rw+   Khoros Visualization image
     VIPS* rw+   VIPS image
      VST* rw-   Truevision Targa image
     WBMP* rw-   Wireless Bitmap (level 0) image
     WEBM  rw+   Open Web Media
     WEBP* rw+   WebP Image Format (libwebp 1.4.0 [020F])
      WMF  r--   Windows Meta File
      WMV  rw+   Windows Media Video
      WPG* r--   Word Perfect Graphics
        X* rw+   X Image
      X3F  r--   Sigma Camera RAW Picture File
      XBM* rw-   X Windows system bitmap (black and white)
       XC* r--   Constant image uniform color
      XCF* r--   GIMP image
      XPM* rw-   X Windows system pixmap (color)
      XPS  r--   Microsoft XML Paper Specification
       XV* rw+   Khoros Visualization image
      XWD* rw-   X Windows system window dump (color)
        Y* rw+   Raw yellow samples
     YAML  -w+   The image format and characteristics
    YCbCr* rw+   Raw Y, Cb, and Cr samples
   YCbCrA* rw+   Raw Y, Cb, Cr, and alpha samples
      YUV* rw-   CCIR 601 4:1:1 or 4:2:2

* native blob support
r read support
w write support
+ support for multiple images
  1. コメントはまだありません。

  1. トラックバックはまだありません。


Warning: Undefined variable $user_ID in /home/r3087696/public_html/blog.eldhrimnir.com/wp-content/themes/monochrome/comments.php on line 172

Fatal error: Uncaught Error: Undefined constant "cs_print_smilies" in /home/r3087696/public_html/blog.eldhrimnir.com/wp-content/themes/monochrome/comments.php:185 Stack trace: #0 /home/r3087696/public_html/blog.eldhrimnir.com/wp-includes/comment-template.php(1617): require() #1 /home/r3087696/public_html/blog.eldhrimnir.com/wp-content/themes/monochrome/single.php(57): comments_template() #2 /home/r3087696/public_html/blog.eldhrimnir.com/wp-includes/template-loader.php(106): include('/home/r3087696/...') #3 /home/r3087696/public_html/blog.eldhrimnir.com/wp-blog-header.php(19): require_once('/home/r3087696/...') #4 /home/r3087696/public_html/blog.eldhrimnir.com/index.php(17): require('/home/r3087696/...') #5 {main} thrown in /home/r3087696/public_html/blog.eldhrimnir.com/wp-content/themes/monochrome/comments.php on line 185