Commit 4c66eae1 authored by Kazuhiko Shiozaki's avatar Kazuhiko Shiozaki

use LC_NUMERIC=C in imagemagick conversion.

because inkscape DPI handling differs by its value.
parent 56f2ee23
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
# #
############################################################################## ##############################################################################
import os
import string import string
import struct import struct
import subprocess import subprocess
...@@ -342,7 +343,10 @@ class Image(TextConvertableMixin, File, OFSImage): ...@@ -342,7 +343,10 @@ class Image(TextConvertableMixin, File, OFSImage):
if self.getContentType() == "image/svg+xml": if self.getContentType() == "image/svg+xml":
data = transformUrlToDataURI(data) data = transformUrlToDataURI(data)
env = os.environ.copy()
env.update({'LC_NUMERIC':'C'})
process = subprocess.Popen(parameter_list, process = subprocess.Popen(parameter_list,
env=env,
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
......
from Products.PortalTransforms.interfaces import ITransform from Products.PortalTransforms.interfaces import ITransform
import os
import subprocess import subprocess
from zope.interface import implements from zope.interface import implements
...@@ -26,7 +27,10 @@ class ImageMagickTransforms: ...@@ -26,7 +27,10 @@ class ImageMagickTransforms:
if depth: if depth:
parameter_list.extend(['-depth', '%s' % depth, '-type', 'Palette']) parameter_list.extend(['-depth', '%s' % depth, '-type', 'Palette'])
parameter_list.append('%s:-' % self.format) parameter_list.append('%s:-' % self.format)
env = os.environ.copy()
env.update({'LC_NUMERIC':'C'})
p = subprocess.Popen(parameter_list, p = subprocess.Popen(parameter_list,
env=env,
stdin=subprocess.PIPE, stdin=subprocess.PIPE,
stdout=subprocess.PIPE, stdout=subprocess.PIPE,
stderr=subprocess.PIPE, stderr=subprocess.PIPE,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment