Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 765395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T16:53:00+00:00 2026-05-14T16:53:00+00:00

<?php function LoadPNG($imgname) { /* Attempt to open */ $im = @imagecreatefrompng($imgname); /* See

  • 0
<?php
function LoadPNG($imgname)
{
    /* Attempt to open */
    $im = @imagecreatefrompng($imgname);

    /* See if it failed */
    if(!$im)
    {
        /* Create a blank image */
        $im  = imagecreatetruecolor(150, 30);
        $bgc = imagecolorallocate($im, 255, 255, 255);
        $tc  = imagecolorallocate($im, 0, 0, 0);

        imagefilledrectangle($im, 0, 0, 150, 30, $bgc);

        /* Output an error message */
        imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc);
    }

    return $im;
}

header('Content-Type: image/png');

$img = LoadPNG('http://www.prideofhome.com/wp-content/uploads/328145505image_11.png');

imagepng($img);
imagedestroy($img);
?>

i am getting error..how to solve.is imagecreatefrompng doesnt support the file from remote server.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T16:53:01+00:00Added an answer on May 14, 2026 at 4:53 pm

    To use a file from a remote server, use imagecreatefromstring in conjunction with file_get_contents:

    $im = imagecreatefromstring(file_get_contents($imgname));
    

    Note that a URL can be used as a filename with file_get_contents only if fopen wrappers have been enabled.

    If this doesn’t solve your problem, clarify your question. Give at least the error you’re receiving. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the PHP function imagettftext() to convert text into a GIF image. The
Is there a Php function to determine if a string consist of only ASCII
How can I get a PHP function go to a specific website when it
This example is from php.net: <?php function Test() { static $a = 0; echo
is there an alternative for mysql_insert_id() php function for PostgreSQL? Most of the frameworks
<?php function toconv(string) { $gogo = array(a => b,cd => e); $string = str_replace(
<?php function data_info($data) { if ($data) { while (!feof($data)) { $buffer = fgets($data); if
I'm looking for the name of the PHP function to build a query string
I have code with the following form: <?php function doSomething{ //Do stuff with MySQL
When using the php include function the include is succesfully executed, but it is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.