Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Paid Work - Image Upload Plugin Development
I’m looking for a plugin specialist to develop a plugin.
The plugin should:
1. Upload an image
2. Pull specific IPTC data from that image
3. Create an article and
4. Place the IPTC data into the Title, Body, Keywords, etc of that article (see below)
5. Place IPTC data into the Alternate text and Caption of the txp image
The image would become the article’s Article image.
This is the IPTC data to be used:
IPTC => TXP
ARTICLE
- Headline => Title
- Caption => Body
- Category (if any) => Category 1
- Supp Cat 1 (if any) => Category 2
- Keywords => Keywords
- City => Specific Custom Field
- Creator => Specific Custom Field
- Source => Specific Custom Field
- Headline => Alternate text
- Headline => Caption
Ideally, this would happen as part of a multiple image upload.
During the image upload process, articles would be automatically created using the above IPTC data.
Is this possible (using the PHP iptcparse function)?
Please contact me to name what you consider a fair price, and to give me an estimate of how long development would take.
Last edited by Kjeld (2019-08-02 09:57:05)
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: Paid Work - Image Upload Plugin Development
Just a heads up. Categories are on their way out and tags on the way in.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: Paid Work - Image Upload Plugin Development
colak wrote #318939:
Just a heads up. Categories are on their way out and tags on the way in.
In that case, the above would probably change to the following:
Category (if any) => Specific Custom Field
Supp Cat 1 (if any) => Specific Custom Field
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: Paid Work - Image Upload Plugin Development
I’ve always fancied developing a plugin like this. If nobody else bites, I’ll do it for you.
I see this as:
- A checkbox alongside the image upload box, like
[ ] Parse IPTC data
, the state of which is remembered if you check it and upload something. - For greatest flexibility, Admin->Preferences->IPTC Map would permit you to define mappings for the Txp <= IPTC fields. Doing it this way would automatically extend the plugin to unlimited custom fields in future.
- A core set of mappings would define which Image fields (alt/caption/title/category) get which bits of IPTC data. So the plugin could be used just to import and populate images alone.
- An optional set would define Article mappings. If defined, Articles would be created using the mapped fields as defined, with each article image set as the corresponding image ID automatically.
Does that seem reasonable?
No idea how long it would take – maybe a week of back and forth given current workload? I don’t know much about iptcparse()
so there’s a learning curve there. And presumably you could supply a bunch of images with various attributes set for testing?
Questions:
- What about the Section in which the article should reside? Should it always assume the ‘Default publishing section’ or use a pref? (I’d probably favour the latter, just in case, but it could use the default pub section if not set).
- What if there’s already an article with the same name?
- Rather than limiting it to IPTC (although that would be the initial scope as it’s more well-defined) does it make sense to, in future, permit EXIF data mapping too? And what about XMP in general? I know the former is more camera-specific and ill-defined so it might not be practical. Just thinking about the plugin name, really. Don’t want to limit it to just one if there might be a way to select and define mappings for more formats in a future version.
EDIT: Interestingly, I don’t see Caption and Category/subcat in the Core ITPC spec. What am I missing?
Last edited by Bloke (2019-08-02 09:31:30)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Re: Paid Work - Image Upload Plugin Development
Bloke wrote #318941:
I’ve always fancied developing a plugin like this. If nobody else bites, I’ll do it for you.
I see this as:
- A checkbox alongside the image upload box, like
[ ] Parse IPTC data
, the state of which is remembered if you check it and upload something.- For greatest flexibility, Admin->Preferences->IPTC Map would permit you to define mappings for the Txp <= IPTC fields. Doing it this way would automatically extend the plugin to unlimited custom fields in future.
- A core set of mappings would define which Image fields (alt/caption/title/category) get which bits of IPTC data. So the plugin could be used just to import and populate images alone.
- An optional set would define Article mappings. If defined, Articles would be created using the mapped fields as defined, with each article image set as the corresponding image ID automatically.
Does that seem reasonable?
No idea how long it would take – maybe a week of back and forth given current workload? I don’t know much about
iptcparse()
so there’s a learning curve there. And presumably you could supply a bunch of images with various attributes set for testing?Questions:
- What about the Section in which the article should reside? Should it always assume the ‘Default publishing section’ or use a pref? (I’d probably favour the latter, just in case, but it could use the default pub section if not set).
- What if there’s already an article with the same name?
- Rather than limiting it to IPTC (although that would be the initial scope as it’s more well-defined) does it make sense to, in future, permit EXIF data mapping too? And what about XMP in general? I know the former is more camera-specific and ill-defined so it might not be practical. Just thinking about the plugin name, really. Don’t want to limit it to just one if there might be a way to select and define mappings for more formats in a future version.
That sounds great, Bloke!
- I have loads of images with IPTC data. Let me know where you want me to send them and how many you need.
- Naturally, you are also free to roam around the admin side of my site, if that helps you to visualize things.
Answers:
- The ability to select a Section would be best.
- In my case, that never happens. But because of article numbers, txp doesn’t really have trouble with article names that are the same, right?
- I don’t need EXIF data mapping. But I can imagine that eventually others may want this if this plugin ends up being available to all.
Additionally
Your question about a default for the Section made me think. It would be helpful if there would also be the ability to have default text for selected custom fields. I use one custom field for the rate of the image for example. It is the same for every image.
As a working name for this plugin: Image Metadata Import ?
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: Paid Work - Image Upload Plugin Development
Kjeld wrote #318943:
txp doesn’t really have trouble with article names that are the same, right?
It’ll let you make them, but it throws a warning for good reason on the admin side. If you try to view a duplicate article on the public site, it’ll only pick the latest as it won’t be able to determine which you want in /section/title
or /title
permlink modes. It may even confuse article counters and next/prev iterations, I can’t remember the exact fallout. But it’s ill-advised. So we’d need to find some way to handle the eventuality, albeit not necessary in your specific case.
I don’t need EXIF data mapping. But I can imagine that eventually others may want this if this plugin ends up being available to all.
If you want exclusivity for a time, that’s fine. I won’t develop it on GitHub.
the ability to have default text for selected custom fields.
I think default text for any field would be useful so yeah, let’s factor that in. Not sure about the Title. Might have to exempt that.
btw, the main reason I didn’t develop this concept before was I couldn’t figure out a neat interface for allowing people to map fields flexibly. I could see, for example, that some people might want to combine camera fields into a single Txp field (splitting is too complicated).
My thought was to have a dropdown list of available IPTC fields – one dropdown alongside every main Txp field. The dropdown would have a blank option – meaning “ignore” – so that if you leave everything like this in the Article prefs, then no article is created. If you leave some fields blank, those fields are left blank in the created article. But if there was also a ‘custom’ value in every dropdown that opens up an input box alongside, you could just type a default value in there.
Crucially perhaps, we could specify a replacement syntax so that fields could be imported ad-hoc. I dunno, off the top of my head:
Address: {Address}, {City}, {Postal Code}
The advantage? If there were any fields not defined in the dropdown that you wanted – say, the IPTC spec is enhanced, or you wanted to combine stuff into a single field – you can define your own as long as you know the IPTC field name. Internally, the plugin would just create a mapping of the single field name (e.g. {replacement}
) so there’s no extra processing required to handle this. It’s just search and replace.
As a working name for this plugin: Image Metadata Import ?
Works for me.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Re: Paid Work - Image Upload Plugin Development
I just checked some of my images using this tool and it appears that the IPTC data also reside in the image as XMP data!
Some sites suggest that XMP will eventually replace ICTP, although this appears to be far in the future.
Does this simplify or complicate matters?
Last edited by Kjeld (2019-08-02 10:49:22)
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
Re: Paid Work - Image Upload Plugin Development
Yeah according to the spec it seems as if IPTC data is a combination of some IIM data (whatever that is) and custom XMP data which is stored as an XML block inside the JPG directly.
Presumably one day this will just become a single (or perhaps multiple) blocks of XMP data. Either way, PHP can handle it either via iptcparse()
which seems to support more tags with each new version of PHP released, or worst case as a generic XML parser which can then extract individual tags using simplexml()
. No biggie either way, but I’d probably start with iptcparse()
and expand scope if necessary in future.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
Re: Paid Work - Image Upload Plugin Development
Sounds
Bloke wrote #318946:
Yeah according to the spec it seems as if IPTC data is a combination of some IIM data (whatever that is) and custom XMP data which is stored as an XML block inside the JPG directly.
Presumably one day this will just become a single (or perhaps multiple) blocks of XMP data. Either way, PHP can handle it either via
iptcparse()
which seems to support more tags with each new version of PHP released, or worst case as a generic XML parser which can then extract individual tags usingsimplexml()
. No biggie either way, but I’d probably start withiptcparse()
and expand scope if necessary in future.
Sounds good.
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline
#10 2019-08-02 11:34:18
- uli
- Moderator
- From: Cologne
- Registered: 2006-08-15
- Posts: 4,306
Re: Paid Work - Image Upload Plugin Development
smd_iummi (image upload in masses incl. metadata import) ;)
In bad weather I never leave home without wet_plugout, smd_where_used and adi_form_links
Offline
Re: Paid Work - Image Upload Plugin Development
Bloke wrote #318941:
EDIT: Interestingly, I don’t see Caption and Category/subcat in the Core ITPC spec. What am I missing?
Caption = Description.
Category/subcat didn’t show up when I used this tool, so I did a search. I found this very old document about IPTC and it has entries for Category and Supplemental Category with the note, “Use of this DataSet is Deprecated. It is likely that this DataSet will not be included in further versions of the IIM.”
I use Photo Mechanic for editing metadata in images. In this program, categories and supplemental categories are still among the options under the headline ‘Status’.
This is what the IPTC site says about IIM.
EDIT:
I found some info about categories on the IPTC site:
Category and Supplemental Category: were deprecated and merged to form the later Subject Newscodes. See the this guideline for mapping Category Codes to the newer Subject Newscodes.
These two properties are synchronised with XMP properties ‘photoshop:Category’ and ‘photoshop:SupplementalCategories’.
Last edited by Kjeld (2019-08-02 11:53:17)
• Old Photos of Japan – Japan in the 1850s~1960s (100% txp)
• MeijiShowa – Stock photos of Japan in the 1850s~1960s (100% txp)
• JapaneseStreets.com – Japanese street fashion (mostly txp)
Offline