Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2005-09-17 14:41:19
- aba
- Plugin Author
- Registered: 2004-04-14
- Posts: 119
aba_import_images (formerly nhn_import_images)
I took over nhn_import_images because of two reasons, Skubiduu had no time left to maintain it and I wanted some features nhn_image_import didn’t have.
Herewith I present: aba_image_import
These were the features of nhn_image_import – if you think they are sufficient check it out at textgarden.org
- imports lots of images into textpattern without the hassle to go through the interface for each image from a path called import in your images directory
- If a file is found that starts with “thumb-” it will be the thumbnail of the image with the same name (thumb-filename.ext and filename.ext).
- Put additional directories in the import path and the directory names will be used for the category the images are imported into (sorry, only one level – categories in textpattern doesn’t allow multiple levels either)
These are the features I added:
- create thumbnails automatically (definable size/cropping – thanks to the class used in textpattern you may even put a small looking glass into the thumbnail) – if cropping is disabled the aspect ratio will be honored
- resize images on the fly (again, aspect ratio will be honored)
- import iptc or exif comment into the textpattern caption
- use Filename minus extension as alt-Description (“_” will be replaced by spaces)
Problems: If you don’t have a safe_mode enabled server the timeout will be disabled for the script. If you use a safe-mode enabled server you may run into problems if you put too many images into the import directory at once. Try to lower the number or disable e.g. resizing. I plan to eventually write a plugin that circumvents this problem using AJAX, but first I have to understand it… ;)
The plugin seems fairly stable on my system, unfortunately my beta testers are unavailable at the moment, Dejan is blowing up something in Denmark with a few of tons TNT (he promised some pictures) and I lost contace to Brandon. You might want to test it on a test server or only a few pictures before messing around with higher demands. Please keep in mind to disable nhn_image_import in case you used it before!
I would have liked to have some examples ready but as you may know there are elections in germany tomorrow and because I’m working for a newspaper IT department my focus is somewhat shifted at the moment. I promised it for some time now so I didn’t want to let you wait any longer. There were reports that sometimes the plugin will import images two times – I wasn’t able to reproduce it but if it happens to you, please enable debug by setting the var to 1 and send me the whole output (you may do it with other problems as well).
You may find it here: http://andreas.banze.de/txp/aba_image_import.txt
The plugin default settings enable the same features nhn_import_images had. please read the help and configure it before you expect to see thumbnails. If you find any errors, please let me know.
Offline
#2 2005-09-26 13:44:55
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: aba_import_images (formerly nhn_import_images)
Thanks aba for adopting Nils nhn_import Plugin… and even improving it.
You should add it to textpattern.org as it is a fine plugin :)
Offline
#3 2005-09-26 21:32:44
- aba
- Plugin Author
- Registered: 2004-04-14
- Posts: 119
Re: aba_import_images (formerly nhn_import_images)
> alexandra wrote:
> Thanks aba for adopting Nils nhn_import Plugin… and even improving it.
> You should add it to textpattern.org as it is a fine plugin :)
I’m waiting for problem reports because I’m still not convinced the “double import” bug is gone – so far you are the only person getting back to me… ;)
Offline
#4 2005-09-26 21:58:54
- jstubbs
- Moderator
- From: Hong Kong
- Registered: 2004-12-13
- Posts: 2,394
- Website
Re: aba_import_images (formerly nhn_import_images)
I just downloaded the plugin and am trying it out. So far, I get this error on the image page:
Notice: Undefined variable: aba_image_importinfo in /textpattern/lib/txplib_misc.php(429) : eval()’d code on line 67
Notice: Undefined variable: aba_image_importinfo in /textpattern/lib/txplib_misc.php(429) : eval()’d code on line 73
Offline
#5 2005-09-26 22:49:37
- aba
- Plugin Author
- Registered: 2004-04-14
- Posts: 119
Re: aba_import_images (formerly nhn_import_images)
hrmph… note to self: debugging is fine but I should test plugins with debugging disabled as well.
I forgot to include it in the list of globals – it will stop the importing function from working but at least all other tasks should work.
Please download again (it should say version 0.4.1 – if not, please empty your browser cache).
The only thing I wonder about is why nobody else found this, it got downloaded 37 times… oh well, maybe there is no need for such a plugin.
Last edited by aba (2005-09-26 22:52:37)
Offline
#6 2005-09-26 23:23:06
- alexandra
- Member
- From: Cologne, Germany
- Registered: 2004-04-02
- Posts: 1,370
Re: aba_import_images (formerly nhn_import_images)
> aba wrote:
> … oh well, maybe there is no need for such a plugin.
oh no, aba, i am convinced it will come handy for many soon. the most read articles on the german txp blog are the ones about imagehandling & photoblogs.
Offline
#7 2005-09-27 12:03:58
- boblet
- Member
- Registered: 2005-08-08
- Posts: 53
Re: aba_import_images (formerly nhn_import_images)
Hey Aba,
nice plugin!
Can the “delete this image” button be changed to a checkbox, allowing multiple image deletion? (like ‘Forms’ interface) Also, how hard would it be for aba_image_importinfo
to import all exif data into a list in the comment field?
peace – boblet
Offline
#8 2005-09-27 17:30:26
- aba
- Plugin Author
- Registered: 2004-04-14
- Posts: 119
Re: aba_import_images (formerly nhn_import_images)
I didn’t do anything with the delete button at all and I doubt that I will do it because the plugin is meant for importing not managing images.
I wanted to ask mary to do another plugin like her upm_img_popper but only for managing images (she already got searching by category and some other nifty things in her plugin) but because the elections I didn’t find the time.
For the exif import: it depends what you want. I didn’t want to write a parsing engine for templates but I might try a little bit simpler approach if you tell me what you need. Another way would be to use zems exif-plugin – it doesn’t use the caption but you have access to every exif data there is.
Offline
#9 2005-09-27 17:46:38
- titox
- New Member
- Registered: 2005-01-28
- Posts: 3
Re: aba_import_images (formerly nhn_import_images)
Hola Aba,
I installed for plug-in in two sites an works well except the error mentioned above:
undefined variable: aba_image_importinfo in /users/home/XXXX/domains/XXXXXX/web/public/textpattern/lib/txplib_misc.php(429) : eval()’d code on line 66 and 72
I didn´t say anything because I never posted here and I tought that it was no important enough and I felt some kind of shame.
I also noticed that when you upload, resize and make thumbs of several images into a directory to assign the category to them when the process finishes they don´t follow the order you expect.
For example if you upload a serie of images named like: car_1.jpg, car_2.jpg, car_3.jpg, car_4.jpg, car_5.jpg, car_6.jpg after the process you can get a serie like 2.jpg, 4.jpg, 3.jpg, 1.jpg, 6.jpg, 5.jpg and that´s no good for the photogalleries generated via the rss_thumbpop plug-in
Last edited by titox (2005-09-27 17:58:40)
Offline
#10 2005-09-27 17:48:25
- jstubbs
- Moderator
- From: Hong Kong
- Registered: 2004-12-13
- Posts: 2,394
- Website
Re: aba_import_images (formerly nhn_import_images)
Thanks for the update aba. I re-installed the plugin and the warning has gone. Question – is there any way to produce a thumbnail that is not from the top left corner of a large image?
Offline