Jump to content

Imgserv

From mediawiki.org
This page is a translated version of the page Imgserv and the translation is 57% complete.

O imgserv é um servidor de dimensionamento e transcodificação de imagens acessível pela rede, baseado em Java. Com ele, é possível:

  • Redimensionar imagens
  • Redimensionar PNGs muito grandes usando uma quantidade constante de memória
  • Transcodificar imagens (p. ex., converter GIFs em PNGs)
  • Rasterizar SVGs
Ele é compatível somente com MediaWiki 1.13 ou superior

Baixe a versão mais recente em tools.wikimedia.de.

Instalar o servidor

Extraia o arquivo e execute bin/run.sh para iniciar o imgserv:

$ gzip -dc imgserv-server-5.tar.gz | tar xf -
$ cd imgserv-server-5
$ bin/run.sh

É possível configurar algumas partes do imgserv em um arquivo de configuração; copie imgserv.conf.example para imgserv.conf e inicie o imgserv desta forma:

$ bin/run.sh -c imgserv.conf

O imgserv suportará automaticamente a transcodificação e o redimensionamento padrão. Veja abaixo como ativar o pngds para o redimensionamento de PNG em memória constante.

Instalar o cliente

Baixe o cliente mais recente em tools.wikimedia.de. Edite o Makefile, se necessário, e digite make para compilá-lo. Instale o imgserv e o imgserv-wrapper em um diretório conveniente (provavelmente será necessário editar o imgserv-wrapper para corrigir o caminho).

To use imgserv for SVGs, add this to your LocalSettings.php :

$wgSVGConverter = 'imgserv';
$wgSVGConverterPath = '/usr/local/bin';

And for bitmap scaling:

$wgUseImageMagick = false;
$wgCustomConvertCommand = "/usr/local/bin/imgserv-wrapper -w %w -h %h %s %d >/dev/null 2>&1";

Ativar a pngds

Atenção Atenção: This is still very experimental. You might find it doesn't work properly, or causes imgserv to crash.

pngds is a library that allows fast resizing of very large PNG images without large memory usage. To enable pngds support in imgserv:

make JAVA=<path to Java installation> <target>

<target> should be one of these options: solaris, solaris-gcc, linux.

  • Copy libpngds.so to a convenient location (e.g. /usr/local/lib).
  • Add this to imgserv.conf:
pngds=yes
tmpdir=/tmp
Using /tmp is not secure on a multiuser server. Use a directory that only the user running imgserv can write to.

imgserv will now use pngds to resize PNGs.