Problem with converting image from remote url

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
hezhez
Posts: 12
Joined: 2012-04-30T10:58:44-07:00
Authentication code: 13

Problem with converting image from remote url

Post 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 ?
Bonzo
Posts: 2971
Joined: 2006-05-20T08:08:19-07:00
Location: Cambridge, England

Re: Problem with converting image from remote url

Post 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?
hezhez
Posts: 12
Joined: 2012-04-30T10:58:44-07:00
Authentication code: 13

Re: Problem with converting image from remote url

Post 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 ?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem with converting image from remote url

Post 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
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: Problem with converting image from remote url

Post 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.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply