Donations accepted

Hosted on verot.net

Resize doesn't work on hosting account

See all posts Reply

Resize doesn't work on hosting account new!
by Steve, 2 years, 4 months ago
Hi,

First thing, thanks for the class,it's brilliant!

I'm using it on a site I just made to upload and resize an image. It works great on my local machine but when I put the site live on hosting ( 1and1 :( ) it doesn't resize the image.

I get no errors or warnings, the log says no image processing wanted.

I'm using the latest version of the script and the upload part is working great, just not the resize part.

Is this just because of the 1and1 hosting or is there anything in the script I could change?
$upl = new Upload($_FILES['cover']);
$path = IMG_PATH . 'covers' . DS;
if ($upl->uploaded) {
  $upl->image_resize = true;
  $upl->image_convert = jpg;
  $upl->image_x = 200;
  $upl->image_y = 150;
  $upl->image_ratio_no_zoom_in = true;
  $upl->process($path);
  if ($upl->processed) {
    echo 'Image uploaded';
  } else {
    echo 'Error : ' . $upl->error;
  }
  echo $upl->log;		
}

Thanks in advance for any helpReply
Re: Resize doesn't work on hosting account new!
by colin, 2 years, 4 months ago
Please copy here the log produced by the classReply
Re: Resize doesn't work on hosting account new!
by Steve, 2 years, 4 months ago
system information
- class version : 0.31
- operating system : Linux
- PHP version : 5.4.0beta1
- GD version : 2.0.34
- supported image types : png gif bmp
- open_basedir : no restriction
- upload_max_filesize : 2M (2097152 bytes)
- language : en_GB
source is an uploaded file
- upload OK
- file name OK
determining MIME type
- Checking MIME type with Fileinfo PECL extension
MAGIC path defaults to /usr/share/file/magic
MIME type detected as application/octet-stream; charset=binary by Fileinfo PECL extension
- MIME validated as application/octet-stream
- Flash may be rewriting MIME as application/octet-stream
- Try to guess MIME type from file extension (jpg): MIME type set to image/jpeg
source variables
- You can use all these before calling process()
file_src_name : 46441_105380692856750_100001544593647_41557_257748_n.jpg
file_src_name_body : 46441_105380692856750_100001544593647_41557_257748_n
file_src_name_ext : jpg
file_src_pathname : /tmp/phpLAQHAe
file_src_mime : image/jpeg
file_src_size : 115373 (max= 2097152)
file_src_error : 0
process file to /kunden/homepages/10/d254907565/htdocs/public/images/covers/
- file size OK
- file mime OK : image/jpeg
- file name safe format
- destination variables
file_dst_path : /kunden/homepages/10/d254907565/htdocs/public/images/covers/
file_dst_name_body : 46441_105380692856750_100001544593647_41557_257748_n
file_dst_name_ext : jpg
- checking for auto_rename
- destination file details
file_dst_name : 46441_105380692856750_100001544593647_41557_257748_n.jpg
file_dst_pathname : /kunden/homepages/10/d254907565/htdocs/public/images/covers/46441_105380692856750_100001544593647_41557_257748_n.jpg
- 46441_105380692856750_100001544593647_41557_257748_n.jpg doesn't exist already
- no image processing wanted
- process OK
Reply
Re: Resize doesn't work on hosting account new!
by Steve, 2 years, 4 months ago
Just an update, I changed the code so it uploads the image then created a new Upload based on the local file to resize it.

This way around gives the error...

- error: Error copying file on the server. copy() failed.Reply
Re: Resize doesn't work on hosting account new!
by Steve, 2 years, 4 months ago
Another update, after some debugging I found that the file isn't being recognised as an image so when the function checks to see if any processing is needed, the is_image variable is set to false preventing the processing.

Any idea why it's not recognising my image file as an image on my hosting account?Reply
Re: Resize doesn't work on hosting account new!
by colin, 2 years, 4 months ago
For some reason, your host doesn't list jpg as a recognized format for GD. You should have this in the log:
- supported image types : png jpg gif bmp

Can you output here the result of the two following lines?
var_dump(imagetypes() & IMG_JPG);
var_dump(gd_info());
Reply
Re: Resize doesn't work on hosting account new!
by Steve, 2 years, 4 months ago
int(0)
array(12) {
["GD Version"]=>
string(27) "bundled (2.0.34 compatible)"
["FreeType Support"]=>
bool(true)
["FreeType Linkage"]=>
string(13) "with freetype"
["T1Lib Support"]=>
bool(false)
["GIF Read Support"]=>
bool(true)
["GIF Create Support"]=>
bool(true)
["JPEG Support"]=>
bool(false)
["PNG Support"]=>
bool(true)
["WBMP Support"]=>
bool(true)
["XPM Support"]=>
bool(false)
["XBM Support"]=>
bool(true)
["JIS-mapped Japanese Font Support"]=>
bool(false)
}Reply
Re: Resize doesn't work on hosting account new!
by colin, 2 years, 4 months ago
JPEG support is deactivated on your host. You need to follow up this issue with them.Reply
Re: Resize doesn't work on hosting account new!
by Steve, 2 years, 4 months ago
Thanks
Told this company never to go with 1and! GrrReply