Menu

Image looks very small

2009-08-27
2012-09-07
  • Gowri Mahadevan

    Gowri Mahadevan - 2009-08-27

    Hi All,

    I am trying to print the images from a file but the image looks very small. This also happens if i try printing it directly. The image is of correct size if i call the php script from a html script throught image tag. But i want to print the image directly from the php script so i tried writing to a file and printing it ...but now the picture looks very small? Can any one please help me???

    Thanks,
    Gowri

     
    • Gowri Mahadevan

      Gowri Mahadevan - 2009-08-31

      thanks a lot for everyone for your support.. i used the GET variables and img src attribute from my php scripts and displayed the graphs.. it works very fine..

       
    • Alex Doll

      Alex Doll - 2009-08-27

      I'm assuming that you are saving the image to a file (probably as a PNG) that you are then loading into another program and printing? If so, what is the other program using as the basis of its file size?

      If you have saved as a JPG instead, check the EXIF information and see what the resolution is set to. The printer may be using that to guide the image size.

      Third thought - you say it looks fine in a browser called by the IMG tag. What do you see if you save that image and load it into your image viewing program?

       
    • Gowri Mahadevan

      Gowri Mahadevan - 2009-08-27

      Hi Alex..

      Thanks a lot for looking into this...

      Yes iam using png..

      I am not using another program, in the same php script i use the below lines
      $tmp is the image file name with the full path

      $image=imagecreatefrompng($tmp);
      imagepng($image);

      If i call the script via html img tag it looks fine but not directly from the php script page..

      If i see the img file using image viewing programs it is still a small image ..
      Thanks,
      Gowri

       
      • Alex Doll

        Alex Doll - 2009-08-27

        What are the "image viewing programs"?

         
    • lbayuk

      lbayuk - 2009-08-27

      Do you know the actual pixel dimensions of the image in the file? What size are you asking PHPlot to make the image (e.g. new PHPlot(800,600)? Do these sizes match?

      Web browsers typically scale images down, not up, so I'm lost here.

       
    • Gowri Mahadevan

      Gowri Mahadevan - 2009-08-28

      I used Windows picture and fax viewer.

      I typically 4 to 5 line graphs in a page, so i use

      $graph =& new PHPlot(2000,4500);

      to have enough space for all graphs...

      Actually my problem is my php script which generates these graph gets some input from another php script... so i dont know how to call the script which generates the graph from html when it needs some input from another php script... :(

      If i hard code those values and view thro html .. it works fine.. but not if i use the php script directly..

       
    • lbayuk

      lbayuk - 2009-08-30

      To pass the data between scripts - for example, the script that handles the requested page and the script which generates the image using PHPlot - you can either use sessions and session variables, or pass the data between the scripts as URL (_GET) parameters. Which works better depends on your application. Using GET parameters is awkward beyond a certain number of variables. Using session variables you can pass any amount of data, and it is secure from client-side tampering, but if you aren't already using sessions the overhead involved may not be worth it.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.