Susi Posted November 18, 2010 Share Posted November 18, 2010 Hello all!I'm getting kinda desperate because I've tried everything (including searching this forum) but without luck.In my shop, product images won't upload. I keep getting this error: Warning: getimagesize(Array) [function.getimagesize]: failed to open stream: No such file or directory in /home1/susipopc/public_html/lorainne/images.inc.php on line 120 and that line inside images.inc.php would be third inside this function:function imageResize($sourceFile, $destFile, $destWidth = NULL, $destHeight = NULL, $fileType = 'jpg') { list($sourceWidth, $sourceHeight, $type, $attr) = getimagesize($sourceFile); if (!$sourceWidth) return false; if ($destWidth == NULL) $destWidth = $sourceWidth; if ($destHeight == NULL) $destHeight = $sourceHeight; $sourceImage = createSrcImage($type, $sourceFile); $widthDiff = $destWidth / $sourceWidth; $heightDiff = $destHeight / $sourceHeight; if ($widthDiff > 1 AND $heightDiff > 1) { $nextWidth = $sourceWidth; $nextHeight = $sourceHeight; } else { if (intval(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 2 OR (intval(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 AND $widthDiff > $heightDiff)) { $nextHeight = $destHeight; $nextWidth = intval(($sourceWidth * $nextHeight) / $sourceHeight); $destWidth = (intval(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 ? $destWidth : $nextWidth); } else { $nextWidth = $destWidth; $nextHeight = intval($sourceHeight * $destWidth / $sourceWidth); $destHeight = (intval(Configuration::get('PS_IMAGE_GENERATION_METHOD')) == 0 ? $destHeight : $nextHeight); } } I've double checked file permissions in img folder and it is not the problem.I've not modified anything on the system, the only "unusual" thing I did was changing "large" image size after I had some products already published, then I had obviously to re-make thumbs...That's all... any ideas!??????I'm about to launch this site and my client is getting desperate, me too....Thanks in advance!S. Link to comment Share on other sites More sharing options...
Susi Posted November 18, 2010 Author Share Posted November 18, 2010 Anyone there? pleaseeee Link to comment Share on other sites More sharing options...
tomerg3 Posted November 18, 2010 Share Posted November 18, 2010 Did you modify anything?Delete any empty folders?Try to print $sourceFile and see what the value of it is. Link to comment Share on other sites More sharing options...
Susi Posted November 19, 2010 Author Share Posted November 19, 2010 That's the point, I've been doing some research and it seems the image is not uploading into img/tmp I haven't deleted any image, just a product subcat I didn't wanted but I did it via backpanel, nothing erased manually.weird, hum? Even weird, I already have some published products, I've uploaded images without a problem. Image is not bigger than the others I've uploaded before (500x600 270kb aprox).I've printed $sourceFile and got guess what: "Array" literally.Any ideas? why $sourceFile is not being populated?If I get no solution by saturday, sadly I'm gonna have to re-install my shop :[Thanks in advance, tomerg3S. Link to comment Share on other sites More sharing options...
tomerg3 Posted November 19, 2010 Share Posted November 19, 2010 sorry, I forgot it is suppose to be an array, try doing print_r($sourceFile)Edit: I'm actually not sure it's an array, you may be printing out a wrong variable, but print_r() will print out the values of an array... Link to comment Share on other sites More sharing options...
Susi Posted November 19, 2010 Author Share Posted November 19, 2010 Hello again here's what I get from print_r():Array ( [name] => 29-67.jpg [type] => image/jpeg [tmp_name] => /var/tmp/phpxRqt4z [error] => 0 => 247566 ) It seems there's no error... but still cannot upload any image. I've checked in tmp directory but there's no image or broken files named phpxRqt4z.Is anything to do with that "/var/tmp/" directory? var is the same as img?now I'm trully lost :[ I wish I could be a php expert right now Thank you!! Link to comment Share on other sites More sharing options...
tomerg3 Posted November 19, 2010 Share Posted November 19, 2010 Make sure you have writing permissions there.Uploaded files get placed there, but then they are automatically deleted at the end of the script. Link to comment Share on other sites More sharing options...
Susi Posted November 19, 2010 Author Share Posted November 19, 2010 Hi!It was 775, now changed to 777... but without luck :SMy client told me she uploaded a new favicon.ico via ftp to img directory. I don't know if that got it messed up... but I'm shure nothing changed, not even the owners.I was thinking about database problems, or might be my internet connection?Thanks again! Link to comment Share on other sites More sharing options...
tomerg3 Posted November 19, 2010 Share Posted November 19, 2010 I'm not sure why sourceFile is an array, most likely something was changed.You can try to change getimagesize($sourceFile); To getimagesize(is_array($sourceFile)?$sourceFile['tmp_name']:$sourceFile); Link to comment Share on other sites More sharing options...
Susi Posted November 19, 2010 Author Share Posted November 19, 2010 Well, I've tested and the image is uploaded but now... is a blank image hummm... actually all image "versions" are blank (small, large, med, etc)That's a progress anyway! Let me try again with another image, maybe it was just the first one.Thnks!----- update:nope... now I have two blank images :Sthank you so much for helping me with this, really I was thinking... maybe an uploading issue itself? now it seems that is uploading an "empty" image--- update 2: Is there any other way to change that $sourceFile thing? humm probably telling is not an array? or is it something to do with image compression? The first products I've uploaded were fine, I contacted my hosting provider and they haven't change anything like GD or php lately.cheers. Link to comment Share on other sites More sharing options...
Susi Posted November 20, 2010 Author Share Posted November 20, 2010 Ok, here's the story.I ended up re-installing Presta in another directory, then I continued to upload my products and everything was fine. Then I go checking for the possibility that this issue is related to uploading images to /img/ directory via FTP... so... I uploaded a new favicon.ico image as my client told me she did... and, guess what? Uploading product images from back office was broken again!!!!!! aaahh!!I don't know what changes in Presta when one does that but my advice is not to upload anything to /img/, always use backend to upload images inherit to Presta system, like Logo, favicon and such.I'm pretty sure this might be a bug, but now I know is not a good idea. By the way, my Presta version is 1.3.2.3.Cheers!! Link to comment Share on other sites More sharing options...
Susi Posted November 22, 2010 Author Share Posted November 22, 2010 Ok, I'm getting the error again! but... trully I don't understand because I have other stores installed in my hosting server, the same last version and I don't get any errors there... just in one domain.It is said that some PHP versions have some issues but not in all stores for me, that's strange.I have intalled the store in diferent directories, assign the domain again, and nothing! the same upload error.I'm getting desperate!!__________________All this was caused by TinyMCE browser update... Link to comment Share on other sites More sharing options...
valadaros Posted November 24, 2010 Share Posted November 24, 2010 Did you try to contact assistance of presta shop?Is there any assistance onlne? Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now