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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T13:17:21+00:00 2026-06-11T13:17:21+00:00

I am getting this Premature end of JPEG file error while resizing some of

  • 0

I am getting this Premature end of JPEG file error while resizing some of the images. Interesting and strange part is that i am getting this error only when i upload any camera taken images, like from mobile, other than those every thing works great. I thought this could be because of the chunk size used in plupload. So, i uploaded with larger sized image to somewhat like 3mb to test. Works fine with images other than camera taken images. So, whenever i upload camera pics i get this error.

Further elaborations on the error: php function imagecreatefromjpeg is throwing an error “imgname.jpg is not a valid JPEG file”.

To resize images i am using Codeigniter’s image Manipulation Class.

  • 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-11T13:17:22+00:00Added an answer on June 11, 2026 at 1:17 pm

    Based on what you have provided, I can only give you my deductions.

    Camera images are usually very big. I suggest that you try to resize the camera images and see if it works.

    What is your PHP version? There is a bug related to this: https://bugs.php.net/bug.php?id=29878

    Please also check if your JPEG files are in RGB format. Somewhere in the manual mentioned that it could not properly load CMYK for certain versions of the GD library.

    Are you open to using another class? I use this class to resize images and have not encountered any problems with it for years.

    Resizing images is as easy as:

    <?php
       include('SimpleImage.php');
       $image = new SimpleImage();
       $image->load('picture.jpg');
       $image->resizeToHeight(500);
       $image->save('picture2.jpg');
       $image->resizeToHeight(200);
       $image->save('picture3.jpg');
    ?>
    

    If all the suggestions did not work out, you can try using ImageMagick.

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

Sidebar

Related Questions

Getting this strange error. In C#, I write to a file (txt) whose location
getting this error while linking an app, some one an idea? ld: duplicate symbol
I´m getting this error while trying to commit to a svn repository: svn: MKACTIVITY
Im getting this linker error that won't let me compile. It only happens on
Getting this error when I submit my form to savetext.aspx action file: Compiler Error
Getting this error: Each GROUP BY expression must contain at least one column that
Getting this error when I follow the simple code example from jsoncpp, that basically
Getting this error on chrome while trying to make cross-domain requests with GWT application.
Im getting this error. ReferenceError: Can't find variable: cordova at file:///android_asset/www/childbrowser.js:87 I have done
Getting this error while trying to erase the last element of a list. I

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.