texlive[57341] Master/texmf-dist: graphicxpsd (6jan21)
commits+karl at tug.org
commits+karl at tug.org
Wed Jan 6 22:44:54 CET 2021
Revision: 57341
http://tug.org/svn/texlive?view=revision&revision=57341
Author: karl
Date: 2021-01-06 22:44:53 +0100 (Wed, 06 Jan 2021)
Log Message:
-----------
graphicxpsd (6jan21)
Modified Paths:
--------------
trunk/Master/texmf-dist/doc/latex/graphicxpsd/LICENSE
trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.pdf
trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.tex
trunk/Master/texmf-dist/doc/latex/graphicxpsd/test-gin-rule-psd.tex
trunk/Master/texmf-dist/tex/latex/graphicxpsd/graphicxpsd.sty
Modified: trunk/Master/texmf-dist/doc/latex/graphicxpsd/LICENSE
===================================================================
--- trunk/Master/texmf-dist/doc/latex/graphicxpsd/LICENSE 2021-01-06 21:22:31 UTC (rev 57340)
+++ trunk/Master/texmf-dist/doc/latex/graphicxpsd/LICENSE 2021-01-06 21:44:53 UTC (rev 57341)
@@ -1,5 +1,7 @@
-Copyright (c) 2017, 2018 Munehiro Yamamoto
+This package is licensed under the terms of the MIT License.
+Copyright (c) 2017, 2018 Munehiro Yamamoto <munepixyz at gmail.com>
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Modified: trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.pdf
===================================================================
(Binary files differ)
Modified: trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.tex 2021-01-06 21:22:31 UTC (rev 57340)
+++ trunk/Master/texmf-dist/doc/latex/graphicxpsd/graphicxpsd.tex 2021-01-06 21:44:53 UTC (rev 57341)
@@ -6,32 +6,32 @@
\usepackage{graphicxpsd}
\title{\textsf{graphicxpsd} Package}
\author{Munehiro Yamamoto}
-\date{2018/01/30 v1.1}
+\date{2021/01/07 v1.2}
\begin{document}
\maketitle
\begin{abstract}
-This package provides Adobe Photoshop Data format (PSD) support
+This package provides Adobe Photoshop Data format (PSD) support
for \textsf{graphicx} package
with \texttt{sips} (Darwin/macOS)/\texttt{magick} (ImageMagick) command.
\end{abstract}
\section{Motivation}
-\textsf{graphicx} package supports already many graphics image formats as bellow.
+\textsf{graphicx} package supports already many graphics image formats as bellow.
\begin{itemize}
\item non-vector formats: jpg, png, bmp, and so on
\item PostScript-style formats: eps, ps
\item PDF-style formats: pdf, ai
\end{itemize}
-However, it currently does not support Adobe Photoshop Data format (PSD).
+However, it currently does not support Adobe Photoshop Data format (PSD).
-Against that, we developed the \textsf{graphicxpsd} package
-to support PSD format via PSD-to-PDF conversion
+Against that, we developed the \textsf{graphicxpsd} package
+to support PSD format via PSD-to-PDF conversion
with two image converters.
\begin{itemize}
-\item \texttt{sips}:
+\item \texttt{sips}:
pre-installed command in Darwin/macOS
-\item \texttt{magick}:
+\item \texttt{magick}:
bundled command in \href{https://www.imagemagick.org/}{ImageMagick}
\end{itemize}
@@ -48,34 +48,42 @@
The list of available options is the following.
\begin{itemize}
-\item |dvipdfmx|, |xetex|, |pdftex|, |luatex|:
-supported driver options;
+\item |dvipdfmx|, |xetex|, |pdftex|, |luatex|:
+supported driver options;
You can also give specific driver option from global option.
-\item |sips| (default), |magick| (same as |imagemagick|), |convert|\footnotemark:
-supported image converters;
+\item |sips| (default),
+|magick| (same as |imagemagick|), |convert|\footnotemark: % ,
+% |graphicsmagick|:
+supported image converters;
\begin{itemize}
-\item
-Darwin/macOS users do not have to do anything
-unless you choose ImageMagick as PSD-to-PDF converter.
-\item
-If you use ImageMagick~7, you may choose |magick|.
-\item
+\item
+Darwin/macOS users do not have to do anything
+unless you choose ImageMagick as PSD-to-PDF converter.
+\item
+If you use ImageMagick~7, you may choose |magick|.
+\item
If you should use ImageMagick~6 or lower version, you just choose |convert|.
+% \item
+% If you use GraphicsMagick, you may choose |graphicsmagick|.
\end{itemize}
+
+\item |cache=true|: supports to include cached images for all PSD files.
+If there does not exist the cached image for a PSD file,
+\textsf{graphicxpsd} attempts PSD-to-PDF conversion of the PSD file.
\end{itemize}
-\footnotetext{When ImageMagick project had released ImageMagick~7,
-they changed \texttt{convert} to \texttt{magick}
-because that might be the usual problem with the conflict of names
-between the ImageMagick's \texttt{convert.exe} and
-the Windows ``\texttt{convert.exe}'' program,
-which complains about invalid parameters, and
-changing the Imagemagick program's name to imconvert and
+\footnotetext{When ImageMagick project had released ImageMagick~7,
+they changed \texttt{convert} to \texttt{magick}
+because that might be the usual problem with the conflict of names
+between the ImageMagick's \texttt{convert.exe} and
+the Windows ``\texttt{convert.exe}'' program,
+which complains about invalid parameters, and
+changing the Imagemagick program's name to imconvert and
using that instead avoided the conflict.}
\section{Example}
-Typeset the following {\LaTeX} document with Lua{\TeX} enabling the shell escape,
+Typeset the following {\LaTeX} document with Lua{\TeX} enabling the shell escape,
that is, run |lualatex -shell-escape|.
\begin{quote}
\small
@@ -93,13 +101,13 @@
\begin{center}
\includegraphics{tigerpsdfmt.psd}
\end{center}
-Incidentally, the above \texttt{tigerpsdfmt.psd} file is converted from
-the \texttt{tiger.eps} file (a.k.a.~``cubic spline tiger''),
+Incidentally, the above \texttt{tigerpsdfmt.psd} file is converted from
+the \texttt{tiger.eps} file (a.k.a.~``cubic spline tiger''),
which comes with Ghostscript.
\begin{quote}
\small
\begin{verbatim}
-$ file tigerpsdfmt.psd
+$ file tigerpsdfmt.psd
tigerpsdfmt.psd: Adobe Photoshop Image, 550 x 568, RGBA, 4x 8-bit channels
\end{verbatim}
\end{quote}
Modified: trunk/Master/texmf-dist/doc/latex/graphicxpsd/test-gin-rule-psd.tex
===================================================================
--- trunk/Master/texmf-dist/doc/latex/graphicxpsd/test-gin-rule-psd.tex 2021-01-06 21:22:31 UTC (rev 57340)
+++ trunk/Master/texmf-dist/doc/latex/graphicxpsd/test-gin-rule-psd.tex 2021-01-06 21:44:53 UTC (rev 57341)
@@ -5,14 +5,19 @@
\documentclass[luatex]{article}%%set driver as global option
\usepackage{graphicx}
\usepackage[%
- magick,%imagemagick,%%same as the one; %%default: sips
+ magick,%imagemagick,graphicsmagick,%%same as the one; %%default: sips
% convert,%% old ImageMagick
+ cache=true,%%default: false
]{graphicxpsd}
\listfiles
\begin{document}
+\begin{itemize}
\makeatletter
-PSD-to-PDF: \@gfxpsd at psdtopdf
+\item PSD-to-PDF: \@gfxpsd at psdtopdf
+
+\item image cache: \if at gfxpsd@imagecache true\else false\fi
\makeatother
+\end{itemize}
%% $ file tigerpsdfmt.psd
%% tigerpsdfmt.psd: Adobe Photoshop Image, 550 x 568, RGBA, 4x 8-bit channels
@@ -19,7 +24,7 @@
\includegraphics{tigerpsdfmt.psd}
\end{document}
-$ pdfinfo tigerpsdfmt4gfxpsd.pdf
+$ pdfinfo tigerpsdfmt4gfxpsd.pdf
Title: tigerpsdfmt4gfxpsd
Producer: /opt/homebrew/Cellar/imagemagick/7.0.7-15/share/doc/ImageMagick-7//index.html
CreationDate: Sat Jan 27 00:10:51 2018 JST
@@ -37,7 +42,7 @@
Optimized: no
PDF version: 1.4
-$ pdfinfo tigerpsdfmt4gfxpsd.pdf
+$ pdfinfo tigerpsdfmt4gfxpsd.pdf
Producer: Mac OS X 10.13.4 Quartz PDFContext
CreationDate: Fri Jan 26 15:12:13 2018 JST
ModDate: Fri Jan 26 15:12:13 2018 JST
@@ -52,4 +57,4 @@
Page rot: 0
File size: 112882 bytes
Optimized: no
-PDF version: 1.3
\ No newline at end of file
+PDF version: 1.3
Modified: trunk/Master/texmf-dist/tex/latex/graphicxpsd/graphicxpsd.sty
===================================================================
--- trunk/Master/texmf-dist/tex/latex/graphicxpsd/graphicxpsd.sty 2021-01-06 21:22:31 UTC (rev 57340)
+++ trunk/Master/texmf-dist/tex/latex/graphicxpsd/graphicxpsd.sty 2021-01-06 21:44:53 UTC (rev 57341)
@@ -2,20 +2,21 @@
% #!rm -f tigerpsdfmt4* && xelatex -shell-escape test-gin-rule-psd
% #!rm -f tigerpsdfmt4* && pdflatex -shell-escape test-gin-rule-psd
%#!rm -f tigerpsdfmt4* && lualatex -shell-escape test-gin-rule-psd
+% #!lualatex -shell-escape test-gin-rule-psd
%%
%% This is file 'graphicxpsd.sty'.
%%
-%% Copyright (c) 2017, 2018 Munehiro Yamamoto
-%%
+%% Copyright (c) 2017-2021 Munehiro Yamamoto
+%%
%% * e-mail: munepixyz at gmail.com, munepi at greencherry.jp
%% * GitHub: https://github.com/munepi
%% * Twitter: @munepixyz
-%%
+%%
%% This package is licensed under the terms of the MIT License.
%%
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{graphicxpsd}
- [2018/01/30 v1.1 Adobe Photoshop Data format (PSD) support for graphicx package
+ [2021/01/07 v1.2 Adobe Photoshop Data format (PSD) support for graphicx package
with sips (Darwin/macOS)/magick (ImageMagick) command]
%% declare package errors
@@ -32,8 +33,9 @@
\DeclareOption{luatex}{\@gfxpsd at dvipdfmxfalse\@gfxpsd at pdftextrue}
\DeclareOption{pdftex}{\@gfxpsd at dvipdfmxfalse\@gfxpsd at pdftextrue}
-%% support two psd-to-pdf commands:
-%% sips (Darwin/macOS), magick/convert (ImageMagick)
+%% support two psd-to-pdf commands:
+%% sips (Darwin/macOS), magick/convert (ImageMagick),
+%% graphicsmagick (GraphicsMagick)
\newif\if at gfxpsd@imagemagick \@gfxpsd at imagemagickfalse
\def\@gfxpsd at psdtopdf{sips}%% as default
\DeclareOption{sips}{%
@@ -44,7 +46,16 @@
\@gfxpsd at imagemagicktrue\gdef\@gfxpsd at psdtopdf{magick}}
\DeclareOption{convert}{%
\@gfxpsd at imagemagicktrue\gdef\@gfxpsd at psdtopdf{convert}}
+\DeclareOption{graphicsmagick}{%
+ \@gfxpsd at imagemagicktrue\gdef\@gfxpsd at psdtopdf{gm\GPT at space convert}}
+%% image cache flag
+\newif\if at gfxpsd@imagecache \@gfxpsd at imagecachefalse
+\DeclareOption{cache=true}{\@gfxpsd at imagecachetrue}
+\DeclareOption{cache=True}{\@gfxpsd at imagecachetrue}
+\DeclareOption{cache=false}{\@gfxpsd at imagecachefalse}
+\DeclareOption{cache=False}{\@gfxpsd at imagecachefalse}
+
\ProcessOptions\relax
%% support the extension .psd (psdtopdf)
@@ -79,11 +90,13 @@
%% read .psd file
\let\clone at Gread@pdf\Gread at pdf
\def\Gread at psdtopdf#1{%
- \typeout{converting: \Gin at base\Gin at ext\GPT at space -> \Gin at base4gfxpsd.pdf}%
- \if at gfxpsd@imagemagick
- \ShellEscape{\@gfxpsd at psdtopdf\GPT at space\Gin at base\Gin at ext\GPT at space\Gin at base4gfxpsd.pdf}%
+ \if at gfxpsd@imagecache
+ \IfFileExists{\Gin at base4gfxpsd.pdf}{%
+ \typeout{including cached image: \Gin at base4gfxpsd.pdf}%
+ }{\typeout{not found: \Gin at base4gfxpsd.pdf}%
+ \@gfxpsd at convert@psd at to@pdf}%
\else
- \ShellEscape{sips -s format pdf \Gin at base\Gin at ext\GPT at space --out \Gin at base4gfxpsd.pdf}%
+ \@gfxpsd at convert@psd at to@pdf
\fi
%% renamed inside: foo.psd -> foo4gfxpsd.pdf
\let\clone at Gin@base\Gin at base
@@ -93,6 +106,15 @@
% \typeout{!!! \Gin at base\Gin at ext}%%=> tigerpsdfmt4gfxpsd.pdf
\clone at Gread@pdf{#1}}
+\def\@gfxpsd at convert@psd at to@pdf{%
+ \typeout{converting: \Gin at base\Gin at ext\GPT at space -> \Gin at base4gfxpsd.pdf}%
+ \if at gfxpsd@imagemagick
+ \ShellEscape{\@gfxpsd at psdtopdf\GPT at space\Gin at base\Gin at ext\GPT at space\Gin at base4gfxpsd.pdf}%
+ \else
+ \ShellEscape{sips -s format pdf \Gin at base\Gin at ext\GPT at space --out \Gin at base4gfxpsd.pdf}%
+ \fi
+}
+
\endinput
%%
%% End of file `graphicxpsd.sty'.
More information about the tex-live-commits
mailing list.