Free Web Hosting
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb HostingFree Web Hosting
View Poll Results:
0%
Voters: 0. You may not vote on this poll


Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 8th, 2003, 04:52 PM
codergeek42's Avatar
codergeek42 codergeek42 is offline
Language Nerd
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Jul 2003
Location: Anaheim, CA (USA)
Posts: 6,388 codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)  Folding Points: 35702 Folding Title: Starter FolderFolding Points: 35702 Folding Title: Starter Folder
Time spent in forums: 1 Month 1 Week 5 Days 17 h 3 m 28 sec
Reputation Power: 886
Send a message via ICQ to codergeek42 Send a message via AIM to codergeek42 Send a message via Yahoo to codergeek42 Send a message via Google Talk to codergeek42
Post PLEASE READ: Lycos UK & GD Library: How to make them work

EDIT: Sorry, the second poll option is supposed to say "I use either of them very little or none at all."

For a few months, since I had signed up for Lycos UK hosting, I liked the idea that they had they GD library available for dynamic images. So I tried to make a dynamic navigation image that could be called like so:
Code:
<img src="nav_button.php?text=link" />
with no luck. When I saved the image's binary file to my HDD and opened it in notepad, I noticed their ad-script at the end, which make the image invalid. After several hours or cursing at Lycos, I figured it all out. you need a Content-Length header for everything that is not HTML. So my code came down to this:
PHP Code:
<?php
  
//File: nav_button.php
  
header"Content-Type: image/jpeg" );
  
$img imagecreatefromjpeg"nav_blank.jpg" );
  
$color imagecolorallocate$img,$RR$GG$BB );
  
imagettftext$img$size$angle$x$y$color"/path/to/font.ttf"urldecode$_GET"text" ] ) );
  
ob_start( );
  
imagejpeg$img );
  
imagedestroy$img );
  
$data ob_get_contents( );
  
ob_end_clean( );
  
header"Content-Length: " strlen$data ) );
  echo 
$data;
  exit;
?>
That way, only the first n bytes specified by the content-length header are downloaded and used, and the image is valid.
(It seems to work for me, anyways...)

EDIT: And as I soon figured out, putting a content-length header will almost always fix probelms with images and binary streams.

I hope this helps someone!
__________________
~~ Peter ~~
( My Blog: ...The thoughts and ravings of a lost and wandering mind... ) :: ( Supporter of the EFF & FSF ) :: ( I'm a GNU/Linux addict and Free Software Advocate. ) :: ( How to Ask Questions the Smart Way ) :: ( The Fedora Project, sponsored by Red Hat ) :: ( GNOME: The Free Software Desktop Project ) :: ( GnuPG Public Key )

Reply With Quote
  #2  
Old December 15th, 2003, 04:34 PM
codergeek42's Avatar
codergeek42 codergeek42 is offline
Language Nerd
Dev Shed God 2nd Plane (6000 - 6499 posts)
 
Join Date: Jul 2003
Location: Anaheim, CA (USA)
Posts: 6,388 codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)codergeek42 User rank is Lieutenant General (80000 - 90000 Reputation Level)  Folding Points: 35702 Folding Title: Starter FolderFolding Points: 35702 Folding Title: Starter Folder
Time spent in forums: 1 Month 1 Week 5 Days 17 h 3 m 28 sec
Reputation Power: 886
Send a message via ICQ to codergeek42 Send a message via AIM to codergeek42 Send a message via Yahoo to codergeek42 Send a message via Google Talk to codergeek42
And then I realized that 50free.com's hosting plan is a whole lot better...

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb HostingFree Web Hosting > PLEASE READ: Lycos UK & GD Library: How to make them work


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway