Converting eps to png [message #179106] |
Thu, 13 September 2012 06:22 |
Fastian
Messages: 20 Registered: June 2012
Karma: 0
|
Junior Member |
|
|
Hi all!
My eps images are stored in the database and I want to display them on web after converting them into png using PHP. Can someone guide me how to proceed? If possible please share any relevant example.
|
|
|
Re: Converting eps to png [message #179108 is a reply to message #179106] |
Thu, 13 September 2012 10:07 |
alvaro.NOSPAMTHANX
Messages: 277 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
El 13/09/2012 8:22, Fastian escribió/wrote:
> My eps images are stored in the database and I want to display them
> on web after converting them into png using PHP. Can someone guide me
> how to proceed? If possible please share any relevant example.
Using the word "convert" suggests that it's a simple format switch, but
it isn't. EPS is not a bitmap format, it's a vector format that needs to
be interpreted by an apporpriate engine. In other words, you need to
*render* or *raster* the file.
I don't know if anyone took the time to write a decent EPS engine in
pure PHP but, if I recall correctly, the ImageMagick [1] command line
utilities offer some sort of support for PostScript files (though I'm
sure the result is not good). A third-party program is probably your
best chance.
[1] http://www.imagemagick.org
--
-- http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
-- Mi sitio sobre programación web: http://borrame.com
-- Mi web de humor satinado: http://www.demogracia.com
--
|
|
|
Re: Converting eps to png [message #179110 is a reply to message #179108] |
Thu, 13 September 2012 10:22 |
The Natural Philosoph
Messages: 993 Registered: September 2010
Karma: 0
|
Senior Member |
|
|
Álvaro G. Vicario wrote:
> El 13/09/2012 8:22, Fastian escribió/wrote:
>> My eps images are stored in the database and I want to display them
>> on web after converting them into png using PHP. Can someone guide me
>> how to proceed? If possible please share any relevant example.
>
> Using the word "convert" suggests that it's a simple format switch, but
> it isn't. EPS is not a bitmap format, it's a vector format that needs to
> be interpreted by an apporpriate engine. In other words, you need to
> *render* or *raster* the file.
>
> I don't know if anyone took the time to write a decent EPS engine in
> pure PHP but, if I recall correctly, the ImageMagick [1] command line
> utilities offer some sort of support for PostScript files (though I'm
> sure the result is not good). A third-party program is probably your
> best chance.
>
> [1] http://www.imagemagick.org
>
>
Certainly the Gimp can read postcript and turn it into bitmaps.
So the problem is soluble.
Ghostcript is a possible command line tool
Personally i'd set up a process to trawl through and store each EPS
image as a rasterised one in the database on an 'as needed' basis.
--
Ineptocracy
(in-ep-toc’-ra-cy) – a system of government where the least capable to
lead are elected by the least capable of producing, and where the
members of society least likely to sustain themselves or succeed, are
rewarded with goods and services paid for by the confiscated wealth of a
diminishing number of producers.
|
|
|
Re: Converting eps to png [message #179112 is a reply to message #179106] |
Thu, 13 September 2012 13:21 |
Salvatore
Messages: 38 Registered: September 2012
Karma: 0
|
Member |
|
|
On 2012-09-13, Fastian <abdulbasit(dot)fast(at)gmail(dot)com> wrote:
> Hi all!
> My eps images are stored in the database and I want to display them on web after converting them into png using PHP. Can someone guide me how to proceed? If possible please share any relevant example.
>
>
I'd recommend you install ImageMagick (it may already be installed on
the PHP server) and run the "convert" command instead. Just run the
command once for each image and store the resulting PNG image in some
other part of the database.
--
Blah blah bleh...
GCS/CM d(-)@>-- s+:- !a C++$ UBL++++$ L+$ W+++$ w M++ Y++ b++
|
|
|