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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:31:59+00:00 2026-05-11T07:31:59+00:00

A client has just asked me to fix an issue with their webside. I

  • 0

A client has just asked me to fix an issue with their webside. I did not build it but here is what’s happening.

The images are stored in the db as longblobs. Before moving to a new server, everything was working a ok. On the new server, some images only display partially. Even though the image is displayed at desired width and height, over a half of the image is either white or gray. EDIT: Only images uploaded after the server change are affected!

This is used for reading the image into a string for db insertion:

move_uploaded_file($_FILES['imagefile1']['tmp_name'],'tmppic.img'))  $tmpstr = fopen('tmppic.img','rb'); $image = addslashes(fread($tmpstr,filesize('tmppic.img'))); 

Here are the PHP functions used for displaying the images: imagecreatefromstring, imagecreatetruecolor, imagecopyresampled, imagejpeg

Since this has started happening after the server move, I am suspecting server configuration.

What is going on?

  • 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. 2026-05-11T07:31:59+00:00Added an answer on May 11, 2026 at 7:31 am

    Ok, figured it out. Looking at the code below.

    if (move_uploaded_file($_FILES['imagefile1']['tmp_name'],'tmppic.img')){ $tmpstr = fopen('tmppic.img','rb'); $image = addslashes(fread($tmpstr,filesize('tmppic.img'))); 

    The uploaded file is moved into the tmppic.img file. That file is constantly used. The problem is that filesize(‘tmppic.img’) is returning the size of the file before move_uploaded_file. So, if the previous tmppic.img had a 120k filesize and the new uploaded file is larger, only 120K worth of info is read, thus the gray area in the pictures.

    I fixed the issue by replacing filesize(‘tmppic.img’) with

    $file_size = $_FILES['imagefile1']['size']; $image = mysql_real_escape_string(fread($tmpstr,$file_size)); 

    Is this a bug?

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

Sidebar

Ask A Question

Stats

  • Questions 69k
  • Answers 69k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Try the Sun Tutorial. These are usually very good May 11, 2026 at 12:30 pm
  • added an answer Well, as far as I can tell, it doesn't! The… May 11, 2026 at 12:30 pm
  • added an answer You should check whether the symbol MYDEFINE is really defined.… May 11, 2026 at 12:30 pm

Related Questions

A client has installed Sql server 2005 reporting services. When we go to the
How do i measure how long a client has to wait for a request.
Our application runs off MySQL, but a client has another application that requires SQL.
I have a java client program that uses mdns with service discovery to find
The client has asked for a number of tables to be extracted into csv's,

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.