Page 1 of 1
Error: attribute not recognized u and n
Posted: 2014-05-06T19:50:12-07:00
by chanbuu
I want to convert some .svg files to .png files using ImageMagick.
But -resize Option doesn't work well in my server.
The command that I entered is here.
Code: Select all
convert a.svg -resize 1024x1024 b.png
This command has worked well in my local server. However, Don't work well in service server.
The Error is
Code: Select all
attribute not recognized: n
attribute not recognized: u
attribute not recognized: n
attribute not recognized: u
This Error is output from "ImageMagick/magick/draw.c" Line: 5603 in the method of TracePath().
Please tell me the workaround or solution to this problem.
Specifications of each server are as follows:
■Local Server
OS : CentOS release 6.5 (Final)
ImageMagick Version:
ImageMagick 6.8.7-0 2014-04-14 Q16
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC
Features: DPC
Delegates: jng jpeg png png zlib
■Service server
OS : CentOS release 6.2 (Santiago Carbon)
ImageMagick Version:
Version: ImageMagick 6.8.9-0 Q16 x86_64 2014-04-23
http://www.imagemagick.org
Copyright: Copyright (C) 1999-2014 ImageMagick Studio LLC
OpenMPFeatures: DPC
Delegates: bzlib fontconfig freetype jng jpeg png x xml zlib
Re: Error: attribute not recognized u and n
Posted: 2014-05-06T20:28:18-07:00
by snibgo
There may be something funny in your SVG file. Please put it somewhere like dropbox.com and paste the URL here. If it is small, just paste the contents between [ code ] and [ /code ].
Re: Error: attribute not recognized u and n
Posted: 2014-05-06T20:49:10-07:00
by chanbuu
Thank you for reply.
I converted the same SVG file on both servers.
On the local server , Converting to PNG worked well , but on the service server, didn't work well.
I wonder if my SVG file is funny.
I'm sorry but I can not upload my SVG file. this is highly confidential.
Re: Error: attribute not recognized u and n
Posted: 2014-05-06T21:10:01-07:00
by fmw42
Your two versions of Imagemagick probably have different delegate libraries to deal with svg. IM can use its internal MSVG (XML), RSVG or Inkscape. Check
convert -list format
and see what is listed for SVG.
On the system that fails, it is likely just using the MSVG (XML) and on the system that works, it is likely using RSVG (or possibly Inkscape).
Re: Error: attribute not recognized u and n
Posted: 2014-05-06T22:16:35-07:00
by chanbuu
> fmw42
I entered this command on both servers.
■Local Server
SVG -w+ Scalable Vector Graphics
■Service Server
SVG rw+ Scalable Vector Graphics (XML 2.6.26)
Will it be a result that is using IM's internal MSVG(XML) on the service server ?
I want to use RSVG on the service server.
What should I do to use RSVG.
Does a option of "./configure" command need ?
Re: Error: attribute not recognized u and n
Posted: 2014-05-06T22:36:35-07:00
by fmw42
■Local Server
SVG -w+ Scalable Vector Graphics
■Service Server
SVG rw+ Scalable Vector Graphics (XML 2.6.26)
Local server has no delegate to read SVG. But it can be written.
Service server is using IM internal MSVG (XML) to read the SVG.
You should install RSVG or Inkscape on both for better performance.
Re: Error: attribute not recognized u and n
Posted: 2014-05-06T22:51:20-07:00
by chanbuu
Incidentally, librsvg2, libpng and libjpeg are installed on each server in the following versions
■Local Server
Code: Select all
librsvg2.x86_64 2.26.0-6.el6_5.3
libpng.x86_64 2:1.2.49-1.el6_2
libpng-devel.x86_64 2:1.2.49-1.el6_2
libjpeg-turbo.x86_64 1.2.1-3.el6_5
libjpeg-turbo-devel.x86_64 1.2.1-3.el6_5
rsvg-convert version 2.26.0
■Service Server
Code: Select all
librsvg2.x86_64 2.26.0-5.el6_1.1.0.1.centos
libpng.x86_64 2:1.2.49-1.el6_2
libpng-devel.x86_64 2:1.2.49-1.el6_2
libjpeg.x86_64 6b-46.el6
libjpeg-devel.x86_64 6b-46.el6
rsvg-convert version 2.26.0
Re: Error: attribute not recognized u and n
Posted: 2014-05-07T03:56:34-07:00
by snibgo
Neither "n" or "u" are SVG 1.1 attributes. (
http://www.w3.org/TR/SVG/attindex.html ) I suspect the SVG file may have bigger problems than using atributes that don't exist.
A couple of things to try:
1. On the service server, "convert -verbose a.svg b.png" and paste all the output here.
2. Find a computer with Inkscape installed, and try to read the svg. If that works, then install Inkscape on the service server, and (with luck) everything will work.
3. Try to find the offending code in the SVG. Search for the strings n=" and u=" (Each string has 3 characters, and is probably in the SVG file with a leading whitespace.) If you have a generic XML reader, that could search for you. I'm not aware of an open-source XML reader, but they must exist.
4. Try editing the SVG file, either to cut it down to a minimal file that fails, or to remove the offending attributes.
Re: Error: attribute not recognized u and n
Posted: 2014-05-07T04:25:55-07:00
by chanbuu
> snibgo
thanks for reply!
I tried the follows command.
output is:
Code: Select all
attribute not recognized: n
attribute not recognized: u
attribute not recognized: n
attribute not recognized: u
a.svg=>b.png SVG 2048x2048=>1024x1024 1024x1024+0+0 16-bit DirectClass 77.8KB 1.000u 0:01.000
However,I have re-installed with the option of "./configure" that is "-with-rsvg=yes".
Then, Error has been resolved.
But, Same phenomenon this problem(
viewtopic.php?f=1&t=19006 ) has occurred.
How would you know what should I resolve.
Re: Error: attribute not recognized u and n
Posted: 2014-05-07T04:28:24-07:00
by chanbuu
The current output that is enterd "convert -verbose a.svg b.png" is as follows:
a.svg=>b.png SVG 2560x2560=>1024x1024 1024x1024+0+0 8-bit sRGB 32.3KB 1.400u 0:01.389
Re: Error: attribute not recognized u and n
Posted: 2014-05-07T05:59:56-07:00
by chanbuu
output from the command :
Code: Select all
convert a.svg -resize 1024x1024 -verbose -identify b.png
is follow :
■Local Server
Code: Select all
Image: a.svg
Format: SVG (Scalable Vector Graphics)
Class: DirectClass
Geometry: 1024x1024+0+0
Base geometry: 2048x2048
Units: Undefined
Type: TrueColorAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 8-bit
Channel statistics:
Red:
min: 0 (0)
max: 255 (1)
mean: 2.37697 (0.00932144)
standard deviation: 21.4034 (0.0839347)
kurtosis: 117.412
skewness: 10.6119
Green:
min: 0 (0)
max: 255 (1)
mean: 1.88739 (0.00740152)
standard deviation: 17.9426 (0.0703631)
kurtosis: 130.818
skewness: 11.2439
Blue:
min: 0 (0)
max: 255 (1)
mean: 1.64421 (0.00644789)
standard deviation: 16.2222 (0.0636166)
kurtosis: 137.088
skewness: 11.5417
Alpha:
min: 0 (0)
max: 255 (1)
mean: 3.57922 (0.0140361)
standard deviation: 29.4608 (0.115532)
kurtosis: 66.7091
skewness: -8.2599
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 64.3323 (0.252284)
standard deviation: 21.8583 (0.0857187)
kurtosis: 1493.01
skewness: 146.504
Alpha: none #00000000
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Background color: white
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 1024x1024+0+0
Dispose: Undefined
Iterations: 0
Compression: Zip
Orientation: Undefined
Properties:
date:create: 2014-05-07T05:47:07-07:00
date:modify: 2014-05-07T05:47:07-07:00
png:bKGD: chunk was found (see Background color, above)
png:IHDR.bit-depth-orig: 8
png:IHDR.bit_depth: 8
png:IHDR.color-type-orig: 6
png:IHDR.color_type: 6 (RGBA)
png:IHDR.interlace_method: 0 (Not interlaced)
png:IHDR.width,height: 2048, 2048
png:sRGB: intent=0 (Perceptual Intent)
signature: b5677c05951a66494421289c21f1cfd14e123f4a8f5b64ab9255ee03107654e0
Artifacts:
filename: test.svg
verbose: true
Tainted: True
Filesize: 0B
Number pixels: 1.049M
Pixels per second: 2.097MB
User time: 0.510u
Elapsed time: 0:01.500
Version: ImageMagick 6.8.7-0 2014-05-07 Q8 http://www.imagemagick.org
a.svg=>b.png SVG 2048x2048=>1024x1024 1024x1024+0+0 8-bit sRGB 31.4KB 0.180u 0:00.189
■Service server
Code: Select all
Image: a.svg
Format: SVG (Scalable Vector Graphics)
Class: DirectClass
Geometry: 1024x1024+0+0
Base geometry: 2560x2560
Resolution: 90x90
Print size: 11.3778x11.3778
Units: Undefined
Type: TrueColorAlpha
Endianess: Undefined
Colorspace: sRGB
Depth: 8-bit
Channel depth:
red: 8-bit
green: 8-bit
blue: 8-bit
alpha: 1-bit
Channel statistics:
Red:
min: 50 (0.196078)
max: 255 (1)
mean: 253.288 (0.993285)
standard deviation: 17.642 (0.0691842)
kurtosis: 111.157
skewness: -10.5784
Green:
min: 28 (0.109804)
max: 255 (1)
mean: 252.906 (0.991788)
standard deviation: 19.8629 (0.0778939)
kurtosis: 105.394
skewness: -10.2382
Blue:
min: 0 (0)
max: 255 (1)
mean: 252.718 (0.991051)
standard deviation: 20.9297 (0.0820771)
kurtosis: 100.597
skewness: -9.96305
Alpha:
min: 255 (1)
max: 255 (1)
mean: 255 (1)
standard deviation: 0 (0)
kurtosis: 0
skewness: 0
Image statistics:
Overall:
min: 0 (0)
max: 255 (1)
mean: 189.728 (0.744031)
standard deviation: 16.9103 (0.0663147)
kurtosis: 4157.78
skewness: -314.514
Rendering intent: Perceptual
Gamma: 0.454545
Chromaticity:
red primary: (0.64,0.33)
green primary: (0.3,0.6)
blue primary: (0.15,0.06)
white point: (0.3127,0.329)
Background color: white
Border color: srgba(223,223,223,1)
Matte color: grey74
Transparent color: none
Interlace: None
Intensity: Undefined
Compose: Over
Page geometry: 1024x1024+0+0
Dispose: Undefined
Iterations: 0
Compression: Undefined
Orientation: Undefined
Properties:
date:create: 2014-05-07T20:39:04+09:00
date:modify: 2014-05-07T20:39:04+09:00
signature: 6bf4b8330afa33d30d55a31e5655a9dbaa0da916975c02435067c0beb2efa1e3
svg:base-uri: a.svg
Artifacts:
filename: a.svg
verbose: true
Tainted: True
Filesize: 0B
Number pixels: 1.049M
Pixels per second: 874KB
User time: 1.190u
Elapsed time: 0:02.199
Version: ImageMagick 6.8.7-0 2014-05-07 Q8 http://www.imagemagick.org
a.svg=>b.png SVG 2560x2560=>1024x1024 1024x1024+0+0 8-bit sRGB 32.4KB 0.600u 0:00.589
Why the difference or would occur in the result?
In the first place Service server, I'm getting worried about where the size of the original they've been recognized as 2560x2560.
I'm sorry If you have just heard