-3

Real image:

Real image

Image after PHP upload:

Image after PHP upload

What's the explanation for that?

Those things have started to happen suddenly. I don't remember doing anything to my code. It is the same since the beginning. I'm afraid those things are happening because of the PHP version (the code is very old, kinda 2002).


P.s: The code is also big, so I want to know what part of the code should I post.

Community
  • 1
  • 1
kratos
  • 101
  • 1
  • 2
  • 9
  • is it up on github somewhere? maybe the part that relates to the upload would help. maybe check both original images on http://regex.info/exif.cgi and discover the difference – filype May 24 '14 at 01:06
  • check out http://stackoverflow.com/questions/4034285/upload-image-without-losing-quality – filype May 24 '14 at 01:12
  • Gist: https://gist.github.com/torquatto/8151d6ef5e7b83dad4dc – kratos May 24 '14 at 01:13
  • 1
    Looks like some color reduction happened. The uploaded image has less than 128 colors while the original one is a true color one – dragon66 May 24 '14 at 01:14
  • 1
    Maravilha, I'd say this is somehow related to the `resizeUploadedFiles` class. are you able to disable resizing? which component are you using? GD, GD2 of NetPBM? – filype May 24 '14 at 01:19
  • GD, but I haven't tried the other ones yet. Should I? – kratos May 24 '14 at 01:22
  • Filype, I guess it worked with GD2. ;D Thank you for noticing about components! But... why GD wasnt working? It worked one day! – kratos May 24 '14 at 01:25
  • is this your first png upload? what happens if you upload a jpg? – filype May 24 '14 at 01:32
  • The same, actually. Happens to any pic. – kratos May 24 '14 at 01:34
  • 1
    Do some work tracking down the bug yourself, find the portion that might actually be causing the error, and if you're still having problems, upload a specific question about the issue. At this point, you're asking people to debug your code for you, and you haven't even provided it. – Cully May 24 '14 at 01:42
  • I'm trying and you can be sure I've tried some workarounds yet. Didn't work. I didn't find the issue. But I've got some ideas now, after reading the things the people has posted for helping. I didn't mean to ask anyone to debug for me, I was just looking for some ideas. Thank you. – kratos May 24 '14 at 01:49

1 Answers1

0

Disabling the resizing should tell you if the resizing is causing the issue.

Also note that you have a variable quality in resizeUploadedFiles make sure this is set to 100.

I'd strongly encourage the use of a framework for this such as: PHP file upload

filype
  • 8,034
  • 10
  • 40
  • 66