Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Please sign in or apply for membership to remove the ads
  1.  
    I've looked through the forum for the problems regarding importing image. I came across the post which explained the troubles with uploading large files but it doesn't seem to fit in my problem.

    I uploaded a number of file in the upload section of plogger using a ftp client. When I go into import, everything runs fine, the thumbnails are generated correclty. When I click to import I get the following error message :


    Fatal error: unlink(/mnt/151/sdb/3/9/tristan.ferroir/Photos/uploads/Coronille (Coronilla emerus), Fabacées.JPG) [function.unlink]: No such file or directory in /mnt/151/sdb/3/9/tristan.ferroir/Photos/admin/plog-admin-functions.php on line 99

    I have to state that first, the problem doesn't come from the special character for the filename. Second, it is always for the 10th file that the error occurs. Let's say I have 20 pictures to import. On the first import, I only get 9 pictures imported, and the error message for the 10th. Then, in my import folder, 10 files are still here. If I choose to import them again, then I get again the error message and there is no more picture to import. Still, I only have 18 pictures in my gallery instead of 20.

    Anyone know how to fix this? Or does anyone came across this problem.

    Thanks in advances
    •  
      CommentAuthorsidtheduck
    • CommentTimeMar 7th 2008 edited
     
    Hi tristan.ferroir,

    I don't necessarily see anything in the code right off the bat that would cause this error on only the 10th photo. Are you sure it doesn't have something to do with your filenames? If I am reading your error correctly, it looks like the code may have some problems with the '(' & ')' paretheticals or the comma instead of with the special character. Try to remove the parethesis and see if it works after that. If so, the code should probably be altered to add the 'sanitize_filename' of the $tmpname variable in the 'add_picture' function to keep this from happening.

    Let me know if changing the parenthesis works and I can help you add the filename sanitization in the proper location if needed.

    scratch that . . . on re-thinking it, sanitizing the filename would really do nothing in this situation
  2.  
    Dear sidtheduck,

    I tried with filenames without any special character and I get exactly the same problem. The 10th file just volatilize somewhere and it breaks the import script.

    I even tried with smaller pictures but since the following is already defined ini_set("memory_limit", "64M"); I don't think this comes from a memory problem.

    If you have any idea.

    Regards
    •  
      CommentAuthorsidtheduck
    • CommentTimeMar 7th 2008
     
    tristan,

    Just out of curiosity, when you say:

    Posted By: tristan.ferroirStill, I only have 18 pictures in my gallery instead of 20.


    is the file that the error happens actually located in the correct folder on your server (if you look at it through FTP) and just not showing up in the gallery? I'm mostly wondering if the file is actually being moved, a fatal error happens to terminate the script, and thus the file information is not sent to the MySQL database. If it is actually being moved, we could try wrapping the unlink() function in an if statement to check if the file is actually there before trying the unlink command (currently, the '@' symbol in front of the unlink command is supposed to suppress error reporting for that command, but somehow on every 10th one it is getting through).

    I can't actually duplicate this error on my installation, so I cannot test a workaround for you. Check to see if the file has actually moved on the server and isn't showing up in your gallery. If it is there, I'll let you know where to edit the code to try it out.
  3.  
    Thank you for your concern,


    I looked in the image folder and the picture is on the folder but it doesn't show up in the gallery. I think it is therefore the problem you suggested about an error when sending the information into the MySQL database.

    I would be glad if you could help with that problem.

    Regards
    •  
      CommentAuthorsidtheduck
    • CommentTimeMar 12th 2008 edited
     
    tristan,

    Try this. Open 'plog-admin-functions.php' and find the following code under the add_picture function (line 99 of the Beta3 download):


    @unlink($tmpname);


    and change it to read:


    if (is_file($tmpname)){
    @unlink($tmpname);
    }


    Hopefully that will clear it up for you!
  4.  
    thank you. I now works perfectly!!!
  5.  
    In fact I came across another new problem after modification. Here it is the new error message

    Fatal error: filemtime() [function.filemtime]: Stat failed for /mnt/151/sdb/3/9/tristan.ferroir/Photos/thumbs/381-baguedonnier_2__colutea_arborescens_.JPG (errno=2 - No such file or directory) in /mnt/151/sdb/3/9/tristan.ferroir/Photos/plog-functions.php on line 494


    This error occurs every 16 pictures. So to import 32 pictures, I have to make to run. Still, I don't lose any pictures, there are in the album but I can't import a lot of picture in a row...

    Any way to fix it?

    Thanks again
    •  
      CommentAuthorsidtheduck
    • CommentTimeMar 24th 2008 edited
     
    tristan.ferroir,

    Try this. Find the following code in plog-functions.php:

    // if thumbnail file already exists and is generated after data for a thumbnail type
    // has been changed, then we assume that the thumbnail is valid.
    $thumbnail_timestamp = @filemtime($thumbpath);

    if (file_exists($thumbpath) && $thumb_config['timestamp'] < $thumbnail_timestamp) {
    return $thumburl;
    }


    and edit it to read:

    // if thumbnail file already exists and is generated after data for a thumbnail type
    // has been changed, then we assume that the thumbnail is valid.
    if (file_exists($thumbpath){
    $thumbnail_timestamp = @filemtime($thumbpath);
    if ($thumb_config['timestamp'] < $thumbnail_timestamp) {
    return $thumburl;
    }
    }


    That should work out nicely for you!