PHP Developer's Network : Network Member
Forums

PHP Classes
Icontem

Subject: Using GIFs from external sources


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend!

      GIF images into animated GIF with native PHP class   All threads   Using GIFs from external sources   (Un) Subscribe thread alerts  
Subject:Using GIFs from external sources
Summary:Can I animate GIFs which are stored somewhere else on the web?
Messages:1
Author:Ben Coakley
Date:2008-07-03 19:23:51
 

  1. Using GIFs from external sources   Reply  
Picture of Ben Coakley
Ben Coakley
2008-07-03 19:23:51
Is it possible to create an animated GIF using GIFs from another web server? I'm trying to animate weather radar data from a series of still frames. Essentially, I've taken your example.php script, and replaced the loop which creates the $frames and $framed arrays with the following lines:

$frames [ ] = "http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image/gif&TRANSPARENT=true&WIDTH=600&HEIGHT=400&SRS=EPSG:4326&BBOX=-92,37,-72,51&STYLES=default&LAYERS=nexrad-n0r";
$framed [ ] = 500;
$frames [ ] = "http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image/gif&TRANSPARENT=true&WIDTH=600&HEIGHT=400&SRS=EPSG:4326&BBOX=-92,37,-72,51&STYLES=default&LAYERS=nexrad-n0r-m05min";
$framed [ ] = 500;

When I use this script, I get the error:

Warning: filesize() [function.filesize]: stat failed for http://mesonet.agron.iastate.edu/cgi-bin/wms/nexrad/n0r.cgi?&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image/gif&TRANSPARENT=true&WIDTH=600&HEIGHT=400&SRS=EPSG:4326&BBOX=-92,37,-72,51&STYLES=default&LAYERS=nexrad-n0r in C:\apache\htdocs\nexrad\GIFEncoder.class.php on line 65

Warning: fread() [function.fread]: Length parameter must be greater than 0 in C:\apache\htdocs\nexrad\GIFEncoder.class.php on line 65
GIFEncoder V2.05: 0 Source is not a GIF image!

Which makes it look like it's trying to read the file from the local filesystem, and not from the web. Am I misunderstanding the 'url' source type? Those URLs are for a public WMS server, which returns GIF files of current weather data.

(My testing server is Windows / Apache 2.2 / PHP 5.1, but this ultimately needs to run under Linux / Apache 2 / PHP 5.)

Thanks,
--Ben

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2008 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products