Jump to content

[CLOSED] Product images not uploading due to failed to open stream: No such file or directory in...


Susi

Recommended Posts

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

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, tomerg3
S.

Link to comment
Share on other sites

Hello again :D

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 :P

Thank you!! :D

Link to comment
Share on other sites

Hi!

It was 775, now changed to 777... but without luck :S

My 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

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 :S

thank you so much for helping me with this, really :D

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

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...