Duplication of images in category

Phoca Gallery - image gallery extension
zocha
Phoca Member
Phoca Member
Posts: 23
Joined: 12 Nov 2008, 14:25

Duplication of images in category

Post 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:
  1. Shouldn't Phoca Galley component check if the image isn't already in the category we try to add it to?
  2. 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
Łukasz Indeka
Joomla VirtueMart
User avatar
caro84g
Phoca Hero
Phoca Hero
Posts: 1369
Joined: 11 Feb 2008, 17:52
Location: Holland
Contact:

Re: Duplication of images in category

Post 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
Please ask your support questions in the forums and not via PM - I delete those PM's
Backup before you do any major change to your website (and test first)
zocha
Phoca Member
Phoca Member
Posts: 23
Joined: 12 Nov 2008, 14:25

Re: Duplication of images in category

Post 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
Łukasz Indeka
Joomla VirtueMart
User avatar
caro84g
Phoca Hero
Phoca Hero
Posts: 1369
Joined: 11 Feb 2008, 17:52
Location: Holland
Contact:

Re: Duplication of images in category

Post 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
Please ask your support questions in the forums and not via PM - I delete those PM's
Backup before you do any major change to your website (and test first)
zocha
Phoca Member
Phoca Member
Posts: 23
Joined: 12 Nov 2008, 14:25

Re: Duplication of images in category

Post 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
Łukasz Indeka
Joomla VirtueMart
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Duplication of images in category

Post by Jan »

see if it was not added into other category but with the same name ...
If you find Phoca extensions useful, please support the project
zocha
Phoca Member
Phoca Member
Posts: 23
Joined: 12 Nov 2008, 14:25

Re: Duplication of images in category

Post by zocha »

Hi,

I've repeated the procedure:
  1. Create "tests" category with category folder "tests".
  2. Go to Images and click on "Multiple add".
  3. Click on "tests" folder to get inside.
  4. Chose first image from the top, chose category "tests" and click Save.
  5. Repeat points 2-4.
  6. Select "tests" in the category filter of Images view.
Result:
Image

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, '');
Łukasz Indeka
Joomla VirtueMart
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 49297
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Duplication of images in category

Post by Jan »

:wink: 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
If you find Phoca extensions useful, please support the project
Post Reply