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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:23:40+00:00 2026-05-22T00:23:40+00:00

SOLVED MY OWN QUESTION! THANKS EVERYONE FOR THE HELP :) Ok. I’m having trouble

  • 0

SOLVED MY OWN QUESTION! THANKS EVERYONE FOR THE HELP 🙂

Ok. I’m having trouble with the code below recognizing the upload FILE TYPE and running the correct function. I can upload PNG just fine and it will convert and resize like it should, but GIF and JPEG don’t and just return a black image. If I remove the png code and try the others individually they work. I can’t figure this out at the moment why when I combine them they won’t work. It’s like together they all use whatever function comes first, instead of going by the FILE TYPE

if ($width > $max_width){
    $scale = $max_width/$width;
    if ($_FILE['image']['type'] = "image/png"){
    $uploaded = resizeImagePNG($large_image_location,$width,$height,$scale);
    } elseif ($_FILE['image']['type'] = "image/gif"){
    $uploaded = resizeImageGIF($large_image_location,$width,$height,$scale);
    } elseif ($_FILE['image']['type'] = "image/jpeg" || $_FILE['image']['type'] = "image/pjpeg"){
    $uploaded = resizeImageJPG($large_image_location,$width,$height,$scale);
    }
    session_start();
    $_SESSION['image2resize'] = $large_image_location;
    }else{
    $scale = 1;
    if ($_FILE['image']['type'] = "image/png"){
    $uploaded = resizeImagePNG($large_image_location,$width,$height,$scale);
    } elseif ($_FILE['image']['type'] = "image/gif"){
    $uploaded = resizeImageGIF($large_image_location,$width,$height,$scale);
    } elseif ($_FILE['image']['type'] = "image/jpeg" || $_FILE['image']['type'] = "image/pjpeg"){
    $uploaded = resizeImageJPG($large_image_location,$width,$height,$scale);
    }
    session_start();
    $_SESSION['image2resize'] = $large_image_location;
    }
}
  • 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-22T00:23:41+00:00Added an answer on May 22, 2026 at 12:23 am

    FIGURED IT OUT!!!!!!!! The verification was screwing things up. Instead of checking if it’s not a image, I checked if it was and it started working. NEW verification -> if ($mime == ‘image/gif’ || $mime == ‘image/jpeg’ || $mime == ‘image/pjpeg’ || $mime == ‘image/png’ || $_FILES[‘image’][‘size’] < 3000000){ working code here } else { error code here } . Thanks for all the help!

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

Sidebar

Related Questions

EDIT: This question is solved, but I can't accept my own answer just yet.
i need your help badly because i cannot solve this problem on my own.
Solved My code was never before used for processing signed values and as such
I'm implementing my own Progress Bar using jQuery. My question is how can I
Update: This question has been solved, so the buggy Firefox behavior will no longer
This may seem like an odd question, but I have my own reasons for
As in my own answer to my own question , I have the situation
NOTE: Solved my own problem, it seems. See the edits. I am trying to
I was playing around with my own Sudoku solver and was looking for some
I came across a problem I cannot solve on my own concerning the downloadable

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.