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

  • SEARCH
  • Home
  • 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 8961715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T15:57:31+00:00 2026-06-15T15:57:31+00:00

Hia, I have just made the code: <?php $ur = $user[‘Skin’]; $filename = "img/Skins/"

  • 0

Hia, I have just made the code:

<?php
$ur = $user['Skin'];

$filename = "img/Skins/" . $ur;
list($w, $h, $type, $attr) = getimagesize($filename);
$img = imagecreatefrompng($filename); 
$src_im = imagecreatefrompng($filename);
$src_x = '30';   // begin x
$src_y = '45';   // begin y
$src_w = '40'; // width
$src_h = '35'; // height
$dst_x = '0';   // destination x
$dst_y = '0';   // destination y

$dst_im = imagecreatetruecolor($src_w, $src_h);
$white = imagecolorallocate($dst_im, 255, 255, 255);
imagefill($dst_im, 0, 0, $white);

imagecopy($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h);

?>
<img src="<?php print_r(imagepng($dst_im)); ?>"/>

What this is supposed to do is get the image "Skin" and cut out the head, so my image:

<img src="<?php print_r(imagepng($dst_im)); ?>"/>

Should only be the head of the skin. However, I am being given this gibberish:

ù¬åä) BðÔ€ÛÂ~Í‹P3£Œ´¶ÛÛ A†YEUkÌ¡èæ_Ê!ÊÔgò
s“Û¤ÇC‚MŒ+‰?>¡·Ñ[ïªWf™.œsḜ3€@á¦~vþf ŒÀì¢ ª}à9¹#åIĉꕡ
èˆÀî”Ûw¥@ù"¢¢™áHªUúݸ÷ÉÇYÿ®šGÅçǘîwqžˆ³ýÏJ
ÕKSêô¯Tis“†Ã¡í©ÈK‡}G:Xqt×ÓIJEpT,úŽ¿ƒ~¼lÞÈ­Ú6]_Óœ>®çqÿNÏ‘çqWŠjš-…(—=g¿ÁŸÍgæ+ùB¹R©Öwܸþn¤:C‰õØËüÛïݱI¸°\ÉÌ[%«V³7ÞÕM¾Í>[ké·IEND®B`‚1"/>

What should I do, and how can I fix it?

Thanks!

  • 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-06-15T15:57:32+00:00Added an answer on June 15, 2026 at 3:57 pm

    A solution is to use your php script as the src attribute of you <img> tag:

    yourScript.php

    ...
    
    $im = imagepng($dst_im);
    
    header('Content-Type: image/png');
    
    imagepng($im);
    imagedestroy($im);
    

    Markup

    <img src="yourScript.php" alt="Some alt text">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hia guys, I'm helping out a friend with some code and so am trying
I have created a file name database.php and here is it's content <?php #Start
I have this code: #include <iostream> using namespace std; class FooA { public: virtual
Hia experts! Last time i was scrolling down the interwebs, i found an appealing
Possible Duplicate: get difference in time in HH:MM format php my time format is
I have a very strange problem with a SessionScoped bean in a JSF 2.0
Hi a grep regex question I think I have many cases of two similar
How can I have a default sub-command , or handle the case where no
Hi a server with a PHP script that deals with image downloads. After it
I'm using the Concurrency and Coordination Runtime and am writing code similar to what

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.