Page 1 of 1
Duplication of images in category
Posted: 16 Jan 2009, 11:42
by zocha
Hi,
Couple of minutes ago I loaded my images to the folder on server with FTP. Next I added them (with multipple add) to one of gallery categories. Then I accidentally added them once again to the same category. Finally I realized that I have two copies of the same images in one category, so I deleted copies.
After that I have two suggestions:
- Shouldn't Phoca Galley component check if the image isn't already in the category we try to add it to?
- And to save some time shouldn't it also check if the thumbnail isn't needed anymore? (After deletion of copies, all thumbnails were recreated, because they were deleted with database rows.)
I think the second thing is not so fundamental because it's probably rare situation, but the first one is important for me.
Best regards,
Łukasz
Re: Duplication of images in category
Posted: 16 Jan 2009, 19:18
by caro84g
Hi,
if you add a folder with multiple add, it works that way. Phoca creates a new category from that folder and if you tick that folder again later, then it'll only add the new added images.
If you tick images Phoca just add them. You can add a image to more than 1 category - which can be useful.
Regards, Carolien
Re: Duplication of images in category
Posted: 16 Jan 2009, 22:54
by zocha
Hi,
caro84g wrote:if you add a folder with multiple add, it works that way. Phoca creates a new category from that folder and if you tick that folder again later, then it'll only add the new added images.
I've check all images inside folder. The category was created earlier, and images checked were inside folder assigned to that category. When I check and add all images again to
the same category, images was added second time to it.
caro84g wrote:If you tick images Phoca just add them.
Shoud I choose whole folder not images inside it? It's not clear for me. Checking folder works another way than checking images?
caro84g wrote:You can add a image to more than 1 category - which can be useful.
I know it and agree with that.
Best regards,
Łukasz
Re: Duplication of images in category
Posted: 17 Jan 2009, 00:57
by caro84g
Hi,
you should choose the whole folder (if the category name is the same as the folder name). So if you have a folder called 'cat1' and you have a category called 'cat1', then select the folder 'cat1' and don't select any category (otherwise Phoca creates a subcategory 'cat1' in 'cat1'.
If you select the folder 'cat1' and no category selected, Phoca sees the category 'cat1' already existing, so it'll seek for the new images in that category / folder.
I hope I explained it clearly,
Regards, Carolien
Re: Duplication of images in category
Posted: 19 Jan 2009, 13:17
by zocha
Hi,
Thanks for detailed explanetion. Unfortunatelly in my case folder name isn't always the same as cateogry name (spaces changed into underscore in folder name and polish letters in category names), so it won't work that way in many cases.
Still I don't understand why it is possible to add twice the same image from the sname folder into the same category.
Best regards,
Łukasz
Re: Duplication of images in category
Posted: 21 Jan 2009, 01:17
by Jan
see if it was not added into other category but with the same name ...
Re: Duplication of images in category
Posted: 27 Jan 2009, 11:45
by zocha
Hi,
I've repeated the procedure:
- Create "tests" category with category folder "tests".
- Go to Images and click on "Multiple add".
- Click on "tests" folder to get inside.
- Chose first image from the top, chose category "tests" and click Save.
- Repeat points 2-4.
- Select "tests" in the category filter of Images view.
Result:
From table dump:
Code: Select all
INSERT INTO `jos_phocagallery` (`id`, `catid`, `sid`, `title`, `alias`, `filename`, `description`, `date`, `hits`, `published`, `checked_out`, `checked_out_time`, `ordering`, `params`) VALUES(1240, 197, 0, '010700010_DSC_1565', '010700010dsc1565', 'tests/010700010_DSC_1565.jpg', '', '2009-01-27 09:30:10', 0, 1, 0, '0000-00-00 00:00:00', 1, '');
INSERT INTO `jos_phocagallery` (`id`, `catid`, `sid`, `title`, `alias`, `filename`, `description`, `date`, `hits`, `published`, `checked_out`, `checked_out_time`, `ordering`, `params`) VALUES(1241, 197, 0, '010700010_DSC_1565', '010700010dsc1565', 'tests/010700010_DSC_1565.jpg', '', '2009-01-27 09:30:44', 0, 1, 0, '0000-00-00 00:00:00', 2, '');
Re: Duplication of images in category
Posted: 29 Jan 2009, 15:15
by Jan

Now I understand what you mean....
This is allowed in Phoca Gallery...
Phoca Gallery has two independent layers: Database layer and Filesystem layer... so if you add e.g. one image into the category, it will be added (database layer) and thumbnails will be created (filesystem layer) and if you will add the same image into the same category, it will be added as new image (with the same name but other id) because e.g. someone wants to have same images with other names, or someone will then move this image in some other category, or.... BUT the thumnails for this image are not more crated, so these two images (in database layer) are using only one image and its thumbnails (filesystem layer) and if you will e.g. move the image (database layer) into other category, the image (filesystem) will be still on the same place and it can be the source for the same images (database layer) in other categories (database layer)... so e.g. you have one image (filesystem) but 20 images (database) in 20 categories (database)
This works in case, if user select image and a category in select box
This doesn't work, if user select the category ... Then category will be added and all images in the category... if user will do the same after, nothing will be added... because it is ready for updating category:
E.g.: your folder is "new" and this folder have 10 images... you will add the into the gallery , all 10 images will be added (database layer)... if you will then upload next 15 images and you click on the category, only new 15 images will be added (updated to database layer) not all 25 images....
Jan