Elxis CMS Forum

Extensions => Components => Topic started by: jimmyz on May 19, 2009, 14:40:23

Title: Batch import pictures in IOS Gallery
Post by: jimmyz on May 19, 2009, 14:40:23
You have installed IOS Gallery component, you are trying to find the batch upload button, but no luck. It ain't there. Here's a step by step quide, for what I did.

There where about 400 pics, some of them commented, to be imported in the new IOS Gallery v1.0. The old gallery component was StarGallery.

Step 1: In the newly installed compo, import manually one category and one pic in it. If categories are just a few, make them all manually.

Step 2: Goto phpmyadmin > Select your database > export > Select table elx_gallery_images > CSV for M$ Excel. Check the "Put fields names in the first row" and the "Save as file" checkbox. Download.

Step 3: Open the downloaded .csv file with Openoffice or something similar (like let's say, Excel). Make sure data is listed like: "id" in the first column, "cid" in the second and so on...

Step 4: In a folder of your pc, you have the photos. You have already used a batch renamer (Gwenview in Linux or ACDSee if in Widowz) and the pics are named like pic_cat-nameA_01, pic_cat-nameA_02, pic_cat-nameA_03. You have already stamped, resized, croped and retouched them (if you where willing) (Jalbum in Linux or ACDSee if in Widowz).

Step 5:
a. Enlong the first "A" column (id), to as many pics you have. It goes like 1, 2, 3, 4, 5, 6, ... You do this by clicking A2 cell and dragging it's bottom right corner downwards (Openoffice).
b. Now, open a new spreadsheet. Type the name of the first pic in the A1 cell. Type the ".jpg" (or else) in the B2 cell. Drag A1's bottom right corner, as you succesfully did in Step 5a. Stop, when you reach the last pic number. Do the same for B1 cell. Save as .csv file, but do not use any separators. Open the file with a text editor, select all, copy. Return to the file where table elx_gallery_images are beeing processed and paste the result in "L" column.
c. Do the same with "M" column. But when you drag, keep the Ctrl button pressed, so the dates aren't increasing.
d. Do the same with dialects (dialect and dialdesc) columns you don't use (if so). Do the same with "K" (published) column.
e. Do the same with "B" column. Remember to change category number when you reach the row where pic_cat-nameA_nn changes to pic_cat-nameB_01.
f. Do the same with "C" column. I used Generic title 1, Generic title 2, for title. Change category title when you reach the row where "cid" changes to the next category. Or if you wish, you can practice your writing skills...
g. Do the same with "D" and "G" column (and those other languages you use).
h. Delete the first row (id, cid, title...).
i. Save file (as .csv).

Step 6: Goto phpmyadmin > Select your database > Select table: elx_gallery_images > Import > Load the file > Check the "Replace table data with file" checkbox > Go. If you get any errors and phpmyadmin complains abour error in the first line of csv file ("Invalid field count in CSV input on line 1"), play arround with the separators in Step 5i. I used as field separator the [;] mark and as text separator the ["] mark.


If you haven't finished the category making manually, do something similar with "elx_gallery_categories" table.

Now, upload the pictures to the components/com_gallery/pictures directory, thumbnails at components/com_gallery/thumbnails (same names, 80x80) and category images at components/com_gallery/category_images.

It's easy!

Use this info on your own risk! Take backup of the database BEFORE doing anything!

[attachment deleted by admin]
Title: Re: Batch import pictures in IOS Gallery
Post by: ahmet on January 12, 2011, 16:13:06
Hello,
Is there anyway installing new pics as bacth??
www.globalpanorama.net
Title: Re: Batch import pictures in IOS Gallery
Post by: CREATIVE Options on January 12, 2011, 16:27:11
The above post is how you can create a batch import.
Now if you want a script to do it for you, I can create it for you.
Title: Re: Batch import pictures in IOS Gallery
Post by: ahmet on December 05, 2011, 22:58:19
sorry for the late response...
wow it would be great...