Page 1 of 1

Problem with converting image from remote url

Posted: 2012-10-01T23:42:58-07:00
by hezhez
Hi !

I'm trying to convert SVG file to JPG.

the SVG includes two images one comes from a remote URL and the other photo is under my server - when the final result should be one photo(JPG) combined with the two photos in the SVG.

When i'm running the command -

exec("convert -density 100 http://remoteurl.com/blabla.svg -compress none -depth 16 blabla.jpg);
The output is that i see only the photo the one from my local server.

but if i run this command(when both of the files under the my server) -
exec("convert -density 100 blabla.svg -compress none -depth 16 blabla.jpg);
It works great !

What might be the problem ?

Re: Problem with converting image from remote url

Posted: 2012-10-01T23:56:56-07:00
by Bonzo
It might be a server/php problem either not allowed to "hotlink" or the local server will not download files from another server?

Have you tried displaing a file from the other server just using the <img> tags?

Re: Problem with converting image from remote url

Posted: 2012-10-02T00:19:38-07:00
by hezhez
Bonzo wrote:It might be a server/php problem either not allowed to "hotlink" or the local server will not download files from another server?

Have you tried displaing a file from the other server just using the <img> tags?
[UPDATE]

I've updated IM to the last version, and now i can get the remote image BUT after the conversion i can see the combined JPG with both images but ONLY the remote image looks blurry and messi.

Any ideas ?

Re: Problem with converting image from remote url

Posted: 2012-10-07T17:35:47-07:00
by anthony
What SVG conversion do you use..
See IM and SVG handling
http://www.imagemagick.org/Usage/draw/#svg

Also you may like to super-sample the rasterization.
That us use say -density 400, read the SVG, then use -scale 25%

This is often used fro vector to raster image conversion, such as in these examples for postscript
http://www.imagemagick.org/Usage/text/#postscript

HOWEVER, SVG typically does not need this.

NOTE: scale is used to 'bin' 16 pixels into one pixel. At other scaling factors you would use -resize.
See Resize and Scaling, Scale Operator
http://www.imagemagick.org/Usage/resize/resize/#scale

Re: Problem with converting image from remote url

Posted: 2012-10-07T17:40:18-07:00
by anthony
Also not that when using http://.... IM is really just reading the image from a "wget" like operation.
You can always do the download using "wget", "curl" or some other web utility.