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 #178547 is a reply to message #178540] Fri, 29 June 2012 13:20 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
On 6/29/2012 6:24 AM, Fastian wrote:
> I am developing an application for the university. One basic
> module/ section of this application is Data Entry. The data
> is entered using Latex (Latex is a type setting language
> and is not a WYSIWYG language). The tex software converts the
> latex code into the required image. For better understanding
> visit the following link:
> http://www.forkosh.com/mathtexpreview.html
>
> You can see that on entering Latex code, the desired output
> is obtained which is actually an image. This image is produced
> by the Tex software and is being fetched and displayed on this
> page. Another way to get that image is as follows:
> <img src="http://www.forkosh.com/mathtex.cgi?$c=a+b$" alt="" border=0 align=middle>
>
> My issue is that I want to get the image generated due to the
> rendering of the Latex code and then display it after re-sizing
> and then want store it in the MYSQL database.
>
> As I dont know the name of the image produced due to rendering
> that's why I can not pick the image with its name. Therefore I
> tried using function "file_get_contents". Though it returns
> some garbage values on echo but what next?
>
> I need to know that how can I proceed further or suggest some
> better way to deal with these issues especially while dealing
> with LateX rendering. Thanks!
>

You don't show the code you're trying to use, so it's all a guess as to
what's wrong. There are many possibilities.

If you're going to display an image, you need to send it as an image.
My guess is that you're displaying it as text.

Web pages are sent with a content-type of text/html. But if the web
page contains an image, the browser makes a second request to the server
for the image. The image will be sent with a content-type of
image/jpeg, image/gif, etc. So the first thing you need to do is ensure
you are sending the correct header when displaying it (in this case it
should be image/gif) (obviously this needs to be done in a separate
script from the rest of the page and accessed with an <img= tag).

So what you could do is in your test page, put something like:

<img src="testimg.php" ....>

Then in your testimg.php file, fetch the file with file_get_contents
then display it with the correct headers, i.e.

header ('Content-type: image/gif');

Of course, if this is the only thing on your test page (it's sending
NOTHING else), you can skip the <img= ...> tag and just send the correct
content-type at the start of your script.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex(at)attglobal(dot)net
==================
[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: Sat Nov 23 00:43:39 GMT 2024

Total time taken to generate the page: 0.05150 seconds