Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include images/captions in InDesign export #22

Closed
4 tasks
jeffpaul opened this issue Apr 11, 2019 · 11 comments · Fixed by #117
Closed
4 tasks

Include images/captions in InDesign export #22

jeffpaul opened this issue Apr 11, 2019 · 11 comments · Fixed by #117
Assignees
Labels
help wanted type:enhancement New feature or request.
Milestone

Comments

@jeffpaul
Copy link
Member

jeffpaul commented Apr 11, 2019

Newspaper owners could benefit from a feature wherein the images and corresponding captions attached to posts would be sent over as part of the InDesign export as well.

Potential solution would be to create a new sub-folder in the existing export file structure called "ArticleName" and within that, both the article .xml file, as well as either (a) the caption embedded into the image as metadata or as a fallback, (b) the caption info conveyed in another .xml file with some type of association to the image file name.

  • Parse article to extract images and captions
  • Move articles to subfolder
  • Add images to zip file
  • Add captions to exports

We will benefit from an example of an XML with an Image file and a caption (otherwise that's another chunk of time to figure out the format).

@jeffpaul jeffpaul added the type:enhancement New feature or request. label Apr 11, 2019
@jeffpaul jeffpaul added this to the Future Release milestone Apr 11, 2019
@jeffpaul
Copy link
Member Author

Input from @ivankruchkoff:

I think based on some research that we can do something like:

<Picture>
<Image href="subfolder/file.jpg"></Image>
<Caption>Caption for the image</Caption>
</Picture>

Some engineering references for whoever might pick up this work:
https://graphicdesign.stackexchange.com/questions/108646/indesign-importing-images-via-xml
http://carijansen.com/indesign-xml-reference-guide/
http://xml.coverpages.org/Adobe-UsingXMLwithInDesign.pdf

@jeffpaul jeffpaul mentioned this issue Apr 11, 2019
@jeffpaul jeffpaul modified the milestones: Future Release, 1.2.0 Apr 30, 2019
@jeffpaul jeffpaul modified the milestones: 1.1.3, 1.2.0 Dec 11, 2021
@refsland
Copy link

refsland commented Apr 2, 2022

Hello @jeffpaul , et.al, thanks so much for developing the 8-day-week plugin. We love the concept, but really needed the image download functionality. So we decided to throw our dev team behind it and join in your fun. So here's the functionality we're adding and will share with you shortly:

  1. Ability to download the image files and include them in the zip file so they are available locally and are easily imported into InDesign. Our beta works well already and we are in debug and QA mode.
  2. We are creating a couple of user options, i.e. Bundle ALL checked posts into one XML document. Include/not include Images.
  3. We've been considering also exporting to a google doc, as DocsFlow has an inDesign plugin that works extremely well with Google Docs (formatting, imaging, etc). This is potentially on the roadmap if we can't do what we need to do with the XML export.

If anyone has any suggestions or additions, or would like to beta test this with us, please let me know.
Thanks everyone for their effort in this and making this available to the community news folks.
Scot

Screen Shot 2022-04-02 at 2 17 55 PM

Screen Shot 2022-04-02 at 2 20 51 PM

@Sidsector9 Sidsector9 modified the milestones: 1.2.0, 1.3.0 Jun 23, 2022
@jeffpaul jeffpaul moved this to Incoming in Open Source Practice Jun 28, 2022
@jeffpaul jeffpaul moved this from Incoming to To Do in Open Source Practice Jun 28, 2022
@xLesy
Copy link

xLesy commented Oct 13, 2022

Hi, I've had a programmer do some custom work (back when 8dayweek was in v 1.0) to implement this to my setup. I don't know much about php, so I can't tell exactly what/how was done, but I can share my files.

But functionality wise: it packs fullsize images in a zip along with post xmls. It sorts articles in seperate folders, so you know which images bellong to which xml (/article name/). It includes both individual images and galleries.

Inside the xml text it marks where an image was using "## image41414.jpg ## caption" so it doesn't just list all the images in the end (in our experience designers tend to miss indesign notes or any smaller symbols, but big ## in text do stand out). Featured image is added under headline (featured image caption is added as first text inside content). Because image placements matter.

Since I can't help with programming, I'd be willing to financially support this development. @refsland maybe we can get in touch and pull our ideas and test together.

@jeffpaul
Copy link
Member Author

@refsland @xLesy if either/both of you want to upload a ZIP of those file changes or link to a GH repo then we could look to pull from there in an update to add this feature

@xLesy
Copy link

xLesy commented Oct 26, 2022

Here you go @jeffpaul zip (link expires by 5. 11.)

My modifications were (bellow are instructions I gave the programmer):

  1. Inside generated XML move <headline> before <content>

  2. Inside XML add custom field (from ACF) opombe_za_dtp <- just remove this. This was an additional field within wp post, where writters could leave comments for the designer, without including those in the post content (so the post could be easily also posted online). It never got much use, so I won't miss it.

  3. Include full-res images inside the generated zip <image href="file:///1_bangkok-1426959.jpg"></image>. If featured image has a caption (if there is no caption, skip this), add it to the beginning inside content marked as:
    ## image41414.jpg ## caption
    If there are additional images inside content, mark them in the same way (image name and caption – this time mark always, even if there is no caption – in this case just mark image name) inside text, where the image was (these are notes for the designer to know where to add images).
    Include other images in xml under content, just like featured image (<image href…).

  4. Sort the tree structure inside zip (Sort the files inside the generated zip by folders for each post, so the zip contains folders for each exported post and inside is the xml and all images for that post.)

  5. Check php 7.2 compatitability

  6. (Not related to image inclusion, but usefull nonetheless) Custom css class for post status inside "Edit print issue". Before articles get included in print, they have to go through proofreading (which we mark with a custom post status). I added some css in the backend to mark proofread article rows green so the designer doesn't accidentally export something that's not proofread yet. (I don't remember exactly how this was done (or if this is already part of the core plugin), but I have custom css statuses (print-lektorirano-row, print-publish-row, print-in-progress-row - so in other words print-<post_status>-row). Then I use admin css plugin and color these rows: green for proofread, yellow for also published on web ...

@sulemanhelp sulemanhelp self-assigned this Jan 8, 2023
@sulemanhelp sulemanhelp moved this from To Do to In Progress in Open Source Practice Jan 24, 2023
@sulemanhelp sulemanhelp moved this from In Progress to To Do in Open Source Practice Jan 24, 2023
@bmarshall511
Copy link
Contributor

Hey @refsland, @xLesy 👋! I was gonna try to dig into this 🕵️‍♀️ and try to implement the changes you folks made. Could one or both of you provide what you've got so I could take a look 👀? Don't want to try and reinvent the wheel 🎡 if it's already spinning! 🌀

@xLesy
Copy link

xLesy commented Jun 12, 2023

Hey @bmarshall511 I was hoping for my changes to be incorporated into main release, but I guess that hasn't happened yet 🙁 @jeffpaul will you be assigning this to anyone else? Since Ben here seems to know php, perhaps he can be of use here?

@bmarshall511 I can provide you with my files (link active till end of june). Would you be kind enough to provide me with any optimizations, bugfixes, php compatibility changes you make?

@bmarshall511
Copy link
Contributor

Hey @xLesy! It's awesome to hear from you! 😄 Thanks a lot for sharing the files with me. I've had a chance to take a look, and it seems that there are modifications in nearly every plugin file. My guess is that these changes were made based on a previous version of the plugin.

I was wondering if it would be possible for your team to update to the latest version of the plugin and incorporate your changes into it. That way, it would be much easier for me to distinguish between the specific changes you've made and the updates made to the plugin since then. Right now, it's a bit challenging to separate your changes from the modifications made in previous plugin updates.

I really appreciate your efforts and the files you've shared. It's just a matter of making it a tad easier for me to review and understand the scope of your changes in relation to the plugin's updates. Thanks a bunch! 🙏

@xLesy
Copy link

xLesy commented Jun 12, 2023

Yes @bmarshall511, the changes were made on v1.0.0 in 2018 (at the time it seemed the plugin was dead). Unfortunately I don't have a team. I paid a programmer on a freelancer site to implement those changes. Perhaps you could compare to v1.0.0 of the plugin and then you can more easily see what was changed 🤷‍♂️ Some changes were just php 7 compatibility, which I assume were already implemented, so you can ignore those.

@bmarshall511
Copy link
Contributor

No worries @xLesy, I've integrated the code changes into the latest version here if you'd like to test. Still needs some work to get the code up to WordPress coding standards, but once that's complete, I'll submit a PR for it.

@xLesy
Copy link

xLesy commented Jun 27, 2023

Hey @bmarshall511 I've given your version a test and it all seems to work fine. Exports seem identical to my old version 👍

When I inspect the page I see an error in my console: "The byte stream was erroneous according to the character encoding that was declared. The character encoding declaration may be incorrect." I use special characters č,š,ž, so maybe you need to use UTF-8? I see the error was also there in my old version. It doesn't seem to have any negative effect.

I'll just give a few recommendations to consider:

  1. Not sure how it will handle future webp images, which are currently available in Performance Lab plugin. Indesign still doesn't play nice with webp, so maybe add an exception, to check if file name is .jpg.webp, just remove webp, or if it's something like -300x200.webp to get original .jpg version (perhaps a check if file exists when replacing .webp with .jpg).

  2. Copy the whole export button section also to the bottom of the Edit print issue page (if you have a lot of articles, it's annoying to have to scroll all the way back to top to export).

  3. If it's not to much work, could you also include some form of css status for article status? Designers usually don't pay attention to words, but having a colored article status does get noticed. Here is how it looks like in my case, when a class "print-(article-status)-row" is added to so i can color the whole row with css: https://file.si/pglX/posnetek-zaslona-2023-06-27-143937.png. This did require manual backend css though. So maybe, would it be possible to convert article status text into a hash, which generates a color automatically? That would probably work for everyone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted type:enhancement New feature or request.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

6 participants