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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T01:31:15+00:00 2026-05-27T01:31:15+00:00

I am uploading image with uploadify V2.1.4. After uploading image I am trying to

  • 0

I am uploading image with uploadify V2.1.4. After uploading image I am trying to create thumbnails of size 60×60 and 80×80 in uploadify.php file. Thumbnails are get created for jpg, png, gif file type. But it is not created when file type is jpeg.

$imgsize = getimagesize($targetFile);
switch(strtolower(substr($targetFile, -3)))
{
    case "jpeg":
    case "jpg":
    $image = imagecreatefromjpeg($targetFile);
    break;
    case "png":
    $image = imagecreatefrompng($targetFile);
    break;
    case "gif":
    $image = imagecreatefromgif($targetFile);
    break;
    default:
    exit;
    break;
}

$width = 60; //New width of image
$height=60;

$src_w = $imgsize[0];
$src_h = $imgsize[1];

$picture = imagecreatetruecolor($width, $height);
imagealphablending($picture, false);
imagesavealpha($picture, true);
$bool = imagecopyresampled($picture, $image, 0, 0, 0, 0, $width, $height, $src_w, $src_h);
$image_name='';
if($bool)
{
$image_name=$newf_name;
$parts=explode('.',$newf_name);
$newf_name=$parts[0]."_90X90.".$parts[1];
    switch(strtolower(substr($targetFile, -3)))
    {
            case "jpeg":
        case "jpg":
        header("Content-Type: image/jpeg");
        $bool2 = imagejpeg($picture,$path."thumb/".$newf_name,80);
        break;
        case "png":
        header("Content-Type: image/png");
        imagepng($picture,$path."thumb/".$newf_name);
        break;
        case "gif":
        header("Content-Type: image/gif");
        imagegif($picture,$path."thumb/".$newf_name);
        break;
    }
}
  • 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-27T01:31:16+00:00Added an answer on May 27, 2026 at 1:31 am
    1. The the operation system of the computer where you uploading your images from is absolutely irrelevant.

    2. Instead of posting the code here you have to debug it yourself.

    There is very little sense in posting code here. You will get but some wild guesses, mostly irrelevant to your case.
    So, you have to make your code to tell you what is going wrong. this is called debugging and being the most important programmer’s skill.

    First of all you have to be sure, that you will be informed of all errors occurred.
    add these lines at hthe top of your code

    ini_set('display_errors',1);
    error_reporting(E_ALL);
    

    and see if if it says something.

    if not – trace your program step by step.
    add some exit‘s in your code along with printing relevant variables contents to check if they have desired value.

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

Sidebar

Related Questions

After uploading an image file (with Greek filename) on my website the image was
I am uploading a image file to the server. Now after uploading the file
I am trying to create a separate model class for image uploading, which was
I want to upload an image in PHP and after uploading I need to
How should I handle image uploading using PHP? How should I handle the chmod
My user is uploading an image of any size XX x YY. I want
i am trying to rename an image file and save the file location in
Is there a way that after uploading an image from the application. I can
I am trying to implement file upload functionality on my site. I have created
Can someone please advise on uploading a file using the DAV protocol in PHP?

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.