FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Reading & Displaying Latex Rendered images
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Reading & Displaying Latex Rendered images [message #178560 is a reply to message #178557] Mon, 02 July 2012 08:10 Go to previous messageGo to previous message
Fastian is currently offline  Fastian
Messages: 20
Registered: June 2012
Karma:
Junior Member
On Monday, July 2, 2012 12:34:33 PM UTC+5, Álvaro G. Vicario wrote:
> El 02/07/2012 8:42, Fastian escribió/wrote:
>> <?
>> $image = file_get_contents('users.gif');
>>
>> header('Content-Type: image/gif');
>>
>> //imagegif($image); // I also tried to display image with imagegif but it also didnt work.
>
> The imagegif() function [1] expects «An image resource, returned by one
> of the image creation functions, such as imagecreatetruecolor()». I
> don't know how you reached the conclusion that you need such functions,
> given that are not even using PHP to generate the image :-?
>
> Probably, readfile() is all you need.
>
>
> [1] http://php.net/imagegif
> [1] http://php.net/readfile
>
>> But the image is NOT displayed on the browser.Where I am wrong?
>
> Browsers are basically designed to ignore invalid stuff and your
> "testing.php" script is possibly printing an error message rather than a
> valid GIF file. I suggest you remove the last layer and debug
> "testing.php" directly.
>
>
>
>
> --
> -- 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
> --



On Monday, July 2, 2012 12:34:33 PM UTC+5, Álvaro G. Vicario wrote:
> El 02/07/2012 8:42, Fastian escribió/wrote:
>> <?
>> $image = file_get_contents('users.gif');
>>
>> header('Content-Type: image/gif');
>>
>> //imagegif($image); // I also tried to display image with imagegif but it also didnt work.
>
> The imagegif() function [1] expects «An image resource, returned by one
> of the image creation functions, such as imagecreatetruecolor()». I
> don't know how you reached the conclusion that you need such functions,
> given that are not even using PHP to generate the image :-?
>
> Probably, readfile() is all you need.
>
>
> [1] http://php.net/imagegif
> [1] http://php.net/readfile
>
>> But the image is NOT displayed on the browser.Where I am wrong?
>
> Browsers are basically designed to ignore invalid stuff and your
> "testing.php" script is possibly printing an error message rather than a
> valid GIF file. I suggest you remove the last layer and debug
> "testing.php" directly.
>
>
>
>
> --
> -- 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
> --



On Monday, July 2, 2012 12:34:33 PM UTC+5, Álvaro G. Vicario wrote:
> El 02/07/2012 8:42, Fastian escribió/wrote:
>> <?
>> $image = file_get_contents('users.gif');
>>
>> header('Content-Type: image/gif');
>>
>> //imagegif($image); // I also tried to display image with imagegif but it also didnt work.
>
> The imagegif() function [1] expects «An image resource, returned by one
> of the image creation functions, such as imagecreatetruecolor()». I
> don't know how you reached the conclusion that you need such functions,
> given that are not even using PHP to generate the image :-?
>
> Probably, readfile() is all you need.
>
>
> [1] http://php.net/imagegif
> [1] http://php.net/readfile
>
>> But the image is NOT displayed on the browser.Where I am wrong?
>
> Browsers are basically designed to ignore invalid stuff and your
> "testing.php" script is possibly printing an error message rather than a
> valid GIF file. I suggest you remove the last layer and debug
> "testing.php" directly.
>
>
>
>
> --
> -- 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
> --



On Monday, July 2, 2012 12:34:33 PM UTC+5, Álvaro G. Vicario wrote:
> El 02/07/2012 8:42, Fastian escribió/wrote:
>> <?
>> $image = file_get_contents('users.gif');
>>
>> header('Content-Type: image/gif');
>>
>> //imagegif($image); // I also tried to display image with imagegif but it also didnt work.
>
> The imagegif() function [1] expects «An image resource, returned by one
> of the image creation functions, such as imagecreatetruecolor()». I
> don't know how you reached the conclusion that you need such functions,
> given that are not even using PHP to generate the image :-?
>
> Probably, readfile() is all you need.
>
>
> [1] http://php.net/imagegif
> [1] http://php.net/readfile
>
>> But the image is NOT displayed on the browser.Where I am wrong?
>
> Browsers are basically designed to ignore invalid stuff and your
> "testing.php" script is possibly printing an error message rather than a
> valid GIF file. I suggest you remove the last layer and debug
> "testing.php" directly.
>
>
>
>
> --
> -- 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
> --

I think readfile is useful when you know the name of the image so that you can access it with its name. In my case the I am trying to use file_get_contents function only because I am not aware of the name of the image file that will result from rendering. Have a look here: http://www.forkosh.com/mathtex.html OR view source of http://www.forkosh.com/mathtexpreview.html.
I thought that without knowing the name of the image you can still get the image output using file_get_contents function. Tell me if it possible to use readfile or with anyother function.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Dreamweaver > can this be done?
Next Topic: Simulating a Form Method=Post submission in PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Tue Nov 26 17:36:00 GMT 2024

Total time taken to generate the page: 0.03539 seconds