Hello,
On my site I have a imagecreatefrompng call that fetches the image.
If this doesn't work I have a backup image that is sent instead.
BUT
the imagecreatefrompng function spits out lines of errors when this happens breaking the image. So how can I tell imagecreatefrompng to just ignore failure?
5 replies to this topic
#1
Posted 16 July 2011 - 02:54 PM
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).
|
|
|
#2
Posted 16 July 2011 - 02:57 PM
Just put a @ at the front of the line like this:
@$sprite = imagecreatefrompng...
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).
#3
Posted 16 July 2011 - 07:24 PM
The error suppression operator is fairly expensive. You may want to use a try/catch instead.
#4
Posted 17 July 2011 - 12:20 AM
Why?
I didn't pay anything!!
*ring* *ring* Oh god!
I didn't pay anything!!
*ring* *ring* Oh god!
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).
#5
Posted 17 July 2011 - 12:23 AM
You'd likely be better to verify if the image exists in the remote resource, before the call rather than relying on independent, and likely unwholesome, checking.
Be sure to read the updated FAQ! || Health is achieved through the same 10,000 steps.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
If a suggested code/method fails, informing us is less important than telling us why or what errors occurred.
#6
Posted 17 July 2011 - 12:28 AM
Mmmph, I want suggestions I can change it happily.
It puts a image their if it doesn't exist, that's good enough for me not to bother googling!
It puts a image their if it doesn't exist, that's good enough for me not to bother googling!
Please, write clearly with proper structure. Double spacing makes the text feel un-jointed, Capitalizing Every Word Means People Stop Before Every Word Sub-Consciously Which Is A Pain In The Backside, and use code tags! (The right most styling box).
1 user(s) are reading this topic
0 members, 1 guests, 0 anonymous users


Sign In
Create Account


Back to top









