Issue with SVG file

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
Budrys
Posts: 6
Joined: 2016-09-02T03:40:59-07:00
Authentication code: 1151

Issue with SVG file

Post by Budrys »

Hello.

I use ImageMagic in Mediawiki.

But I have some issue.When I upload any svg file image is not converted correctly:

Correct: http://awoiaf.westeros.org/index.php/Fi ... sguard.svg
Wrong: http://westeros.com.pl/index.php?title= ... sguard.svg

Correct:http://awoiaf.westeros.org/index.php/Fi ... _Haigh.svg
Wrong: http://westeros.com.pl/index.php?title= ... _Haigh.svg

Here is my LocalSettings.php:

Code: Select all

#ImageMagic
$wgUseImageMagick = true;
#$wgImageMagickConvertCommand = 'C:/ImageMagick/convert.exe'; # for windows
$wgImageMagickConvertCommand = '/usr/local/bin/convert';

#SVG
$wgFileExtensions = array( 'png', 'gif', 'jpg', 'jpeg', 'ppt', 'pdf', 'psd', 'mp3', 'xls', 'xlsx', 'swf', 'svg', 'doc','docx', 'odt', 'odc', 'odp', 'odg', 'mpp');
$wgSVGConverter = 'ImageMagick';
$wgAllowTitlesInSVG = true;
$wgSVGConverterPath= '/usr/local/bin';
$wgLoadFileinfoExtension = true;
$wgMimeDetectorCommand = "file -bi";
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Issue with SVG file

Post by snibgo »

What version of IM are you using? What are your commands? What delegate is doing the rendering (MSVG, RSVG or Inkscape)? What is wrong with the conversions?
snibgo's IM pages: im.snibgo.com
Budrys
Posts: 6
Joined: 2016-09-02T03:40:59-07:00
Authentication code: 1151

Re: Issue with SVG file

Post by Budrys »

I use

As I mentioned correct images are here:
http://awoiaf.westeros.org/index.php/Fi ... sguard.svg
http://awoiaf.westeros.org/index.php/Fi ... _Haigh.svg

When I download them and upload on my mediawiki I get this:
http://westeros.com.pl/index.php?title= ... sguard.svg
http://westeros.com.pl/index.php?title= ... _Haigh.svg

But if You go straight to image it is correct:
http://westeros.com.pl/images/6/6d/Kingsguard.svg

Something is wrong when I upload images. Some details are changed or missed.
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: Issue with SVG file

Post by snibgo »

So, the black versions of the raster images are wrong. What version of IM created them? What were the commands? What delegate was used?
snibgo's IM pages: im.snibgo.com
Budrys
Posts: 6
Joined: 2016-09-02T03:40:59-07:00
Authentication code: 1151

Re: Issue with SVG file

Post by Budrys »

My version is ImageMagick 6.9.3-2

I'm not sure how to check commands and delegate :)
Budrys
Posts: 6
Joined: 2016-09-02T03:40:59-07:00
Authentication code: 1151

Re: Issue with SVG file

Post by Budrys »

My version is ImageMagick 6.9.3-2

I'm not sure how to check commands and delegate :)
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issue with SVG file

Post by fmw42 »

You can check your delegates from

Code: Select all

convert -version
for the purpose of finding out what delegate is IM using to process your SVG file -- Inkscape, RSVG or Imagemagick's MSVG (XML). You can also see what delegates and versions of your SVG renderer from

Code: Select all

convert -list format
He is asking for the Imagemagick commands you used to process your image -- your code.
Budrys
Posts: 6
Joined: 2016-09-02T03:40:59-07:00
Authentication code: 1151

Re: Issue with SVG file

Post by Budrys »

[budrysl2@s53:: ~/domains/westeros.com.pl/public_html ]:$ convert -version
Version: ImageMagick 6.9.3-2 Q16 x86_64 2016-02-04 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2016 ImageMagick Studio LLC
License: http://www.imagemagick.org/script/license.php
Features: Cipher DPC OpenMP
Delegates (built-in): bzlib fontconfig freetype jbig jng jpeg lzma png tiff webp x xml zlib
Budrys
Posts: 6
Joined: 2016-09-02T03:40:59-07:00
Authentication code: 1151

Re: Issue with SVG file

Post by Budrys »

[budrysl2@s53:: ~/domains/westeros.com.pl/public_html ]:$ convert -list format
Format Mode Description
-------------------------------------------------------------------------------
3FR r-- Hasselblad CFV/H3D39II
A* rw+ Raw alpha samples
AAI* rw+ AAI Dune image
AI rw- Adobe Illustrator CS2
ART* rw- PFS: 1st Publisher Clip Art
ARW r-- Sony Alpha Raw Image Format
AVI r-- Microsoft Audio/Visual Interleaved
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* -w- Microsoft Windows bitmap image (V2)
BMP3* -w- 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
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
CRW r-- Canon Digital Camera Raw Image Format
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
DCX* rw+ ZSoft IBM PC multi-page Paintbrush
DDS* rw+ Microsoft DirectDraw Surface
DFONT* r-- Multi-face font package (Freetype 2.6.2)
DNG r-- Digital Negative
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
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
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%".

FITS* rw- Flexible Image Transport System
FRACTAL* r-- Plasma fractal image
FTS* rw- Flexible Image Transport System
G* rw+ Raw green samples
G3* rw- Group 3 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
GROUP4* rw- Raw CCITT Group4
H* -w- Image expressed as a 'C/C++' char array
HALD* r-- Identity Hald color lookup table image
HDR* rw+ Radiance RGBE image format
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
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
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
JPE* rw- Joint Photographic Experts Group JFIF format (62)
JPEG* rw- Joint Photographic Experts Group JFIF format (62)
JPG* rw- Joint Photographic Experts Group JFIF format (62)
JPS* rw- Joint Photographic Experts Group JFIF format (62)
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 MPEG-4 Video
MAC* r-- MAC Paint
MAGICK* rw- Predefined Magick Image (LOGO, ROSE, etc.); output same as 'H'
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.21)
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+ MPEG-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
ORF r-- Olympus Digital Camera Raw Image File
OTB* rw- On-the-air bitmap
OTF* r-- Open Type font (Freetype 2.6.2)
PAL* rw- 16bit/pixel interleaved YUV
PALM* rw+ Palm pixmap
PAM* rw+ Common 2-dimensional bitmap format
PANGO* --- Pango Markup Language
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.6.2)
PFB* r-- Postscript Type 1 font (binary) (Freetype 2.6.2)
PFM* rw+ Portable float format
PGM* rw+ Portable graymap format (gray scale)
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 (62)
PLASMA* r-- Plasma fractal image
PNG* rw- Portable Network Graphics (libpng 1.6.21)
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.8)
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
PPM* rw+ Portable pixmap format (color)
PREVIEW* -w- Show a preview an image enhancement, effect, or f/x
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
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 (XML 2.9.3)
SVGZ rw+ Compressed Scalable Vector Graphics (XML 2.9.3)
TEXT* rw+ Text
TGA* rw- Truevision Targa image
THUMBNAIL* -w+ EXIF Profile Thumbnail
TIFF* rw+ Tagged Image File Format (LIBTIFF, Version 4.0.3)
TIFF64* rw- Tagged Image File Format (64-bit) (LIBTIFF, Version 4.0.3)
TILE* r-- Tile image with a texture
TIM* r-- PSX TIM
TTC* r-- TrueType font collection (Freetype 2.6.2)
TTF* r-- TrueType font (Freetype 2.6.2)
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
WEBP* rw- WebP Image Format (libwebp 0.4.1[0203])
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
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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issue with SVG file

Post by fmw42 »

SVG rw+ Scalable Vector Graphics (XML 2.9.3)
So this means (XML) that you are using the IM internal MSVG renderer. I would suggest you try installing RSVG or better Inkscape and see if it then fails. Those are much better SVG renderers.
mayhem2408
Posts: 2
Joined: 2019-03-25T21:40:12-07:00
Authentication code: 1152

Re: Issue with SVG file

Post by mayhem2408 »

i have an issue between two different servers running two slightly different versions.
Attached in the original SVG file.
http://dev.metchit.com.au:8090/metchit_ ... 020521.svg

Output PNG from V6.9.3-7 running on a Windows 10 Apache PHP server.
Image

Output PNG form V6.9.4-10 running on a Linux server (Hosted by my service provider, so I have limited control over it)
Image

As you can see, my local windows version works fine, but my hosted linux version is not working correctly. Both files where created with exactly the same source file and the same php code. Any clues on what I can check?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Issue with SVG file

Post by fmw42 »

It may be the SVG renderer. Imagemagick has its own MSVG/XML renderer that is not very good. Better is the RSVG delegate that must be installed with ImageMagick. Lastly and the best would be to install Inkscape. It will be used automatically with current versions of ImageMagick (6.7.9.0 or higher). Check to see what renderer is being used. You can tell the first two from

convert -list format

and look at the line staring with SVG. At the end of the line it will say XML or RSVG.

Get your hosting service to upgrade PNG and install RSVG or Inkscape.
mayhem2408
Posts: 2
Joined: 2019-03-25T21:40:12-07:00
Authentication code: 1152

Re: Issue with SVG file

Post by mayhem2408 »

Thanks for the tip. Got it working with the RSVG renderer.
Post Reply