dt: import a style: how hard can it be ?

:grinning_face_with_smiling_eyes:

fix is merged: https://github.com/darktable-org/darktable/pull/10690

@LateJunction

This issue was just fixed by victoryforce.

I just pulled and build the latest development version, imported and applied a bunch of the jade-nl styles at random and all works as expected.


EDIT: @MStraeten : LOL

What is the usual process for making such fixes available to people like me, with limited ability to download from GitHub ? Should I be waiting now until the mid-year 2022 release to get the fix?

I thought I read elsewhere in this forum that you had updated the dtstyles in your repository (?) - but I could be mistaken. This led me to conclude that the fix for my originally raised issue required 2 components: 1. dtsyles that needed to be edited to remove blanks and line spaces, and 2. code changes which would be able to cater for ‘malformed’ dtstyles (whatever that means). That doesn’t make sense to me, as it seems to imply that only the revised code would be necessary.
Further, when I looked at your dtsyles on GitHub (about 10 minutes ago) none of them were newer than 2 years old. So I have completely got things mixed up here. Can you make sense of it for me?

Also, when I tried to download (right-click then ‘Save Link As…’) a sample style, chosen at random, in your ‘Fuji’ collection, I get a large text file (about 225KB) which appears to be html and not XML. I was expecting a file of about 5KB. The only way I can get such a file is by ‘opening’ a sample style listed in GitHub in my browser, select and copy the displayed XML. paste that into an editor and save that as a text file of type .dtstyle on my PC. Surely there must be a way to simply download it from GitHub, but I couldn’t find it in the GitHub guide.

If you look at the issue (and the pull request that fixed it) you can see it has a milestone of 3.8.1. This means that it is intended to be delivered in the 3.8.1 bug fix release. There is no specific schedule for bug fix releases but they usually happen within the few months following the main feature release (depending on the content and whether there are any urgent fixes needing inclusion). For example, 3.6.0 was released in July and 3.6.1 in September, 3.4.0 was released in December and 3.4.1 in February.

People who build from source can get an early preview of these fixes by building the 3.8.x branch (which will eventually become release 3.8.1).

Elstoc dealt with the darktable (“code”) part which basically says: Wait until 3.8.1 comes available.

About the dt.styles repo: No changes have to be made to fix this issue, which is purely darktable (3.8.0) related. Not sure what you read about me updating dt.styles. I did add a Heads-Up to make sure people are aware about the possible unwanted side effects. So, Yeah, I did make a change :grinning_face_with_smiling_eyes:

Thanks for taking the time; this is much clearer to me now.

1 Like

That’s a super explanation for me; allows me to put things into a sensible time context. Thank you.

minify-xml.txt (696 Bytes)

Hi All,
I too was confused by this XML parsing issue with the awesome Darktable 3.8.0.
Kudos to the many developers making such quality s/ware available to photo enthusiasts :slight_smile:

Attached please find a tiny bash script for processing styles that will not load, along with the excellent Fujifilm XTrans III styles ready to use that I have already “minified” for anyone without Linux/MacOS.

The bash script has the extension “.txt” appended to allow me to upload it. I’m new on here - sorry :slight_smile:

My script assumes that the modified styles will be output to the folder “out”. Please modify to suit you needs and preferences.

I hope that this post helps anyone stung by this problem with the latest Darktable.

Also a huge “thank you” to the creator of the Fujifilm styles. In my humble opinion they are absolutely first rate :-).

Kind Regards
Fuji-XTrans-III_-_Minified_Styles.zip (30.7 KB)

#!/bin/bash

##
## Process Darktable style files to remove all extraneous whitespace
##

########################################
# Credits:-
# https://www.linuxquestions.org/questions/programming-9/reformat-%27pretty%27-xml-to-one-line-entries-651089/
# Answer #2 from brianmcgee

# https://unix.stackexchange.com/questions/9496/looping-through-files-with-spaces-in-the-names
#

########################################

# save the current IFS environment variable then change to newline
OIFS="$IFS"
IFS=$'\n'

# loop through each file in the input dir
for file in `find . -type f -name "*.dtstyle"`
do
    echo "Processing $file"
    xmllint --noblanks $file > ../out/$file
done

IFS="$OIFS"

exit 0
1 Like