Re: do I use fopen or fsockopen to get an image as a stream of bytes?



On 4 Nov 2005 09:42:55 -0800, lkrubner@xxxxxxxxxxxxx wrote:

>How do I get an image like that, as a stream of bytes? Which function
>do I use?

Where are you getting it from?
What format is the image in?

You probably want a sequence of:

http://uk.php.net/file_get_contents - get the image from a file or URL

http://uk.php.net/imagecreatefromstring - create a GD image object

http://uk.php.net/manual/en/function.imagesx.php
http://uk.php.net/manual/en/function.imagesy.php
http://uk.php.net/manual/en/function.imagecolorat.php

- loop over all the pixels in the image, converting to whatever your
representation is (looks like hex representation of brightness level in a
greyscale image?)
--
Andy Hassall :: andy@xxxxxxxxxxx :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
.



Relevant Pages

  • Re: Pretty printing experts, pretty please?
    ... T _is_ a stream designator for terminal I/O, but FORMAT does not ... streams for *terminal-io*, and because the LispM had windowing, every window ...
    (comp.lang.lisp)
  • Re: Data table text I/O package?
    ... regular and homogenuous data in mind. ... Given a data format much like in, ... I said XML is good for parsing of data if you cannot tell in advance that the data stream is totally free of errors. ... However, if some data item contains a separator due to an error, you loose the whole stream, or use the wrong data without noticing this, in the worst case. ...
    (comp.lang.ada)
  • Re: Secure Web Server Version 2.0 available for download
    ... > It's the record formats with metadata, such as variable-length format, that ... > the decision to limit support in this version to stream and fixed record ... > variable-length files, which is why we provided the convert utility to help ... was transmitted with a CRLF terminator. ...
    (comp.os.vms)
  • Re: silent semantic changes with reiser4
    ... Not the main stream, I think, but we do need a way to make "eight-stream ... | It should be a simple format. ... | compound format out there. ... | simple compound format and encourage applications to use this one if the ...
    (Linux-Kernel)
  • Re: Hardware musings
    ... The only problem arises when you try to recreate a physical disk. ... this bit stream format should encompass any formatting known or unknown. ... Tracks are continuous circles. ...
    (comp.sys.apple2)