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 8393201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T19:43:13+00:00 2026-06-09T19:43:13+00:00

So I am working on an upload script (this is my first experience in

  • 0

So I am working on an upload script (this is my first experience in PHP), and I have come across a problem:

Upload works correctly, the file gets uploaded to ‘../images/’ than gets renamed to the mysql ID.
Once that is done I would like to resize the image to 96px x 96px. Than the problem starts:

I do have GD installed correctly (tested with a script), and here is my “resize” code:

$orig_image = imagecreatefromjpeg("../image/$newname");
$sm_image = Imagecreate(96,96);
Imagecopyresized($sm_image,$orig_image,0,0,0,0,50,50,imagesx($orig_image),imagesy($orig_image));
imageJPEG($sm_image);

The reslult I get is not a resized image, the image file is the exact same, but I do get:

RéussiÿØÿàJFIFÿþ>CREATOR: gd-jpeg v1.0 (using IJG JPEG v62), default quality ÿÛC       $.' ",#(7),01444'9=82<.342ÿÛC     2!!22222222222222222222222222222222222222222222222222ÿÀ``"ÿÄ   ÿĵ}!1AQa"q2‘¡#B±ÁRÑð$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ     ÿĵw!1AQaq"2B‘¡±Á  #3RðbrÑ $4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz‚ƒ„…†‡ˆ‰Š’“”•–—˜™š¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖרÙÚâãäåæçèéêòóôõö÷øùúÿÚ?ðØãÍYK}ݪh"Éé]6‹¥B¢;˦M§%bqôÇ×9¯>¾!SWgÔá0Ö¹‘iáûÛј-݆3é‘ê3Ö¤“ÃW‘Åæ4nHÈ ôëÒ½ÍÞpÐ[4~n îRÆ:€~ƒÚ¢¹žrbV,O žyFqŒcvéŸzò´*¹ZÈõ–ŠÑ£Ë®,ŠŽeË    Bx¯HÕ¬âž2茲©çqáò2ñ÷®>þØuƒ^®Îµ<œÇ+Š‹œAÒ–œëµÈ#Úôœµ´ (¢Q@N›n.."‰†UœnÇËÔóÛŒ×|ó[,o¹ŒoŒ°øSÓë\.™(‚D”…<çÐŒç]m»\_Û—´¼Æh‹$c®O9Á==}>s›’od}ö)SL œ‘ÜK4xGb´}Kìù³ô Ÿò+AnæOÜ„SI½U;rFpO$ƒƒž¤˜¬‹†¸³VزJd ác°n€8Ïõïšµ 鹓ÊXæg9@™Þ¨§9À8ãon•É8I¤Þ¦îÌ•ü©'؈©FeG'°àçƒùŒ’Er:ý´+©O¢±ˆ¶PHÏ8üë§û@0•XÊü¡¦’ry°{qšlí´»{SSlÌü[B3¸Œ`ç¦oÀãµkBn”¯øw"¬T£fyü oxñ?ÞIöÈúÕj¹ªÌ×”Ò±Éb?ªuôÔïÈ®|!%Zj;]þaEU˜…Q@>z‘Œ0‚=«®ÐutFrÊÞx‘6õ|ƒÎîÇÿ­é^e ÑCZ0ê3Çzòñ8?h™õx<Òœ £3Ò Žæò%–u+3LÏ2Œ”q’ON„c¸Ï"­K$«t³Fö±Èîùjw‡+‚1Æ}xõõâ¸[oÞ[¬j$"}êæÁçüMMqâÛé”(tˆàE¯_p3^d°5œºXôþ³IësPÕ`µÛ@O›&w;Ôã9ãõÈ®sXÕ¥»|¼ŒÄn,IosšÍ¸Ô¤˜îfɬù®wµÝ‡Á¨Y½ÎLN>œbÔJWGuËŸ§ò¨iÎw94Úö²>>¤¹¦ßvQE2Š( À§‡aÐÓh iÛbA4ƒø¨óåþ÷éQÑK•í'Ý’yÒ{ô¦cÔÒQEœä÷aES$(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢Š(¢ŠÿÙ

Any tips on getting this to work ?

Thanks in advance !

  • 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-09T19:43:14+00:00Added an answer on June 9, 2026 at 7:43 pm

    Don’t forget to add headers

    header("Content-Type: image/jpeg");
    

    Since you want 96×96 it should be:

    imagecopyresized($sm_image,$orig_image,0,0,0,0,96,96,imagesx($orig_image),imagesy($orig_image));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working through a small file upload script (learning experience) and I noticed that
I am working on an image upload script and ran into this problem. Using
I'm currently working on an AJAX file upload script, which works like a charm
I'm working on a upload script and using move_uploaded_file() function. The problem is, that
So I have my upload script working just fine, but now it's a matter
Using this upload script and it was working ok a week ago but when
I am working on a PHP upload script and when testing my error checks,
this is for user avatar and users photo albums. I have gotten upload working
I am working on an upload script. If a user uploads a file and
I have this script working with jquery and uploadify $('#uploader').uploadify({ 'uploader' : '/admin/includes/uploadify/uploadify.swf', 'script'

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.