codeigniter photo thumb create and upload -
This gives an empty screen: / it uploads the first image, all right. In comparison, it calls _create_thumbnail and gives it an empty screen at "$ the-> image_lib-> resize ()": /
What could be the problem?
Thank you!
/ ** * ======================================= ================================ Upload photo * * * thumb = 210px - 160px * original = 500px - 385px * * /
function img_upload () {$ config ['upload_path'] = 'upload /'; $ Config ['allowed_types'] =' GIF | JPG | JPEG | PNG '; $ Config ['max_size'] = '1000'; $ Config ['max_width'] = '1920'; $ Config ['max_height'] = '1280'; $ Config ['width'] = 500; $ Config ['height'] = 385; $ This- & gt; Load-> Library ('upload', $ config); If (! $ This-> upload-> do_upload ()) copy $ $ this- & gt; Upload-> Display_errors (); Other {$ fInfo = $ this- & gt; Upload-> Data (); $ This- & gt; _create_thumbnail ($ fInfo ['file_name']); $ Data ['uploadInfo'] = $ fInfo; $ Data ['thumbnail_name'] = $ fInfo ['raw_name'] '_thumb' $ FInfo ['file_ext']; // Set See $ this- & gt; Load-> View ('upload_success', $ data); }} Function _create_thumbnail ($ fileName) {$ config ['image_library'] = 'GD2'; $ Config ['source_image'] = 'Upload /' $ FileName; $ Config ['create_thumb'] = true; $ Config ['maintain_ratio'] = true; $ Config ['width'] = 210; $ Config ['height'] = 160; $ This- & gt; Load-> Library ('image_lib', $ config); If (! $ This-> image_lib-> resizing ()) echo $ this- & gt; Image_lib- & gt; Display_errors (); Check your curly braces here
Code> if (! $ This-> upload-> do_upload ()) copy $ $ this- & gt; Upload-> Display_errors (); Else {
It seems that you are matching syntax styles
Comments
Post a Comment