help on image header

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shotokan99

    #1

    help on image header

    i have a web service and accessing it is done thru query string. how
    to access a certain header field using php? the sample program i saw
    was done in java and it goes like this:

    String shortcutcode = connection.getH eaderField("Sho rtCut");
    ByteArrayInputS tream bis = new ByteArrayInputS tream (imageBytes,
    0,imageBytes.le ngth);
    BufferedImage bim = ImageIO.read(bi s);
    bim = bim.getSubimage (0,0,bim.getWid th(),bim.getHei ght()-12);

    how to do the same in php?

  • Jerry Stuckle

    #2
    Re: help on image header

    shotokan99 wrote:
    i have a web service and accessing it is done thru query string. how
    to access a certain header field using php? the sample program i saw
    was done in java and it goes like this:
    >
    String shortcutcode = connection.getH eaderField("Sho rtCut");
    ByteArrayInputS tream bis = new ByteArrayInputS tream (imageBytes,
    0,imageBytes.le ngth);
    BufferedImage bim = ImageIO.read(bi s);
    bim = bim.getSubimage (0,0,bim.getWid th(),bim.getHei ght()-12);
    >
    how to do the same in php?
    >
    Look at the $_GET array, i.e. $_GET['ShortCut'];

    --
    =============== ===
    Remove the "x" from my email address
    Jerry Stuckle
    JDS Computer Training Corp.
    jstucklex@attgl obal.net
    =============== ===

    Comment

    • shotokan99

      #3
      Re: help on image header

      can you give an example on how to do it?

      Comment

      • ZeldorBlat

        #4
        Re: help on image header

        On Jul 2, 2:10 am, shotokan99 <soft_devj...@y ahoo.comwrote:
        can you give an example on how to do it?
        Sure:

        $shortcutcode = $_GET['ShortCut'];

        Comment

        • shotokan99

          #5
          Re: help on image header

          actually here's how i did it:

          $ch = curl_init();
          $timeout = 0;
          curl_setopt ($ch, CURLOPT_URL, $xmyurl);
          curl_setopt ($ch, CURLOPT_CONNECT TIMEOUT, $timeout);
          curl_setopt($ch , CURLOPT_RETURNT RANSFER, 1);
          curl_setopt($ch , CURLOPT_BINARYT RANSFER, 1);

          $image = curl_exec($ch);
          curl_close($ch) ;

          now where shall i insert "$shortcutc ode = $_GET['ShortCut'];"? what i
          am trying to do here is to get 2 separate data, which is the header
          and the image. with the image no problem because i was able to make it
          already.

          tnx..



          Comment

          Working...