Page 1 of 1
media problem?
Posted: Mon Feb 27, 2006 12:07 am
by SHRIKEE
While testing some things and therefor removing folders and stuff in the mediamanager i noticed that thumbnails are not removed properly when a image is removed.
Also when a complete folder with content is beign removed it does not delete the folder because the thumbs remain... The folder then has to be removed again to remove it completely...
also a suggestion for the a future release, in the images table in the database it would be nice to allow a description field for each image.. this is also nice for the mediagallery/usergallery plugin
Re: media problem?
Posted: Mon Feb 27, 2006 2:43 pm
by garvinhicking
When you delete a folder, do you check the option "Delete all files"? That checkbox needs to be checked, else the thumbnails can't really be deleted.
On my system, the thumbnails to an image are definitely removed; did you check if it is maybe a permission issue? Does the webserver have write privileges for the thumbnails?
Adding a comment column for the images is defintely on our todo list (
http://sourceforge.net/tracker/index.ph ... tid=542825) - but we did not have time/a developre for that.
Best regards,
Garvin
Posted: Mon Feb 27, 2006 4:18 pm
by SHRIKEE
i checked the thingy indeed. if its a permission problem then still serendipity is in error i think. as serendipity creates the folder and thumb it should also sets userpermissions.
i just checked. the folders are set 0777, images are 0664 and thumbs are 0666. Seems ok for me. Owner and group are apache.
im using version 1.0beta1 on fedora core 4, apache 2.0.54, php 5.0.4, mysql 4.1.13
Posted: Mon Feb 27, 2006 7:47 pm
by garvinhicking
The question is if serendipity really creates the thumbnail. On some image magick setups it could be that the user of the image magick creation code is different than the apache webserver. That's why I asked.
But your permissions sound fine, if the owners are the same.
But when deleting, did you check the option to remove all directory contents? Does the user you are operating with have hte adminImagesDelete privilege? Because the code of serendipity_deleteImage() does try to delete the thumbnail. Maybe you could look into the code and see why it does not unlink the images, please? The function code should be easy to understand, and since I cannot reproduce the problem on my machine it would really help if you could see why the image file doesn't get deleted for you?
If you don't want to modify the code, please mail here back again and I try to create the debugging code for you...
Regards,
Garvin
Posted: Mon Feb 27, 2006 8:27 pm
by SHRIKEE
i did check the option yes.
im using gd to resize stuff.
the image itself gets deleted, its the thumbnail that remains somehow :S
as if its not included on the unlink array. Yesterday i had a quick look at the code but couldnt find the appropriate functions where image deletion was handled. i figured it would be the images.inc.php or alike but didnt see unlink code

Posted: Tue Feb 28, 2006 7:32 pm
by garvinhicking
Thanks! I found the bug and committed a fix to our SVN. Inside the deleteImage() function the problem was that we used $dfThumb[...] inside the foreach loop instead of $thumb[].
Thanks for helping,
Garvin