Close

Tracking down a colour bug.

A project log for The Open Voice Factory

Free speech, for people that need it most

joe-reddingtonJoe Reddington 10/01/2016 at 18:350 Comments

#### Introduction

Some of our beta testers have been reporting a colour problem in the uploaded templates. Time to fix it.

#### Steps

#### Follow on goals

***

# Resources

# Live Notes

###### 01/10/2016-18:33:23 GMT+1:

Started mapping

###### 01/10/2016-18:35:30 BST:

Need to find some examples.

###### 01/10/2016-18:37:58 BST:

Let's look at http://designs.theopenvoicefactory.org/e87ad0006c19a37d4cf6addf6d5f3333/

This is the results.

![Screenshot showing... ](../../../images/Screen Shot 2016-10-01 at 18.38.39.png)

###### 01/10/2016-18:39:18 BST:

But this is the original.

![Screenshot showing... ](../../../images/Screen Shot 2016-10-01 at 18.39.45.png)

###### 01/10/2016-18:40:06 BST:

Okay, let's look at the json file. It's here: http://designs.theopenvoicefactory.org/e87ad0006c19a37d4cf6addf6d5f3333/pageset.json

###### 01/10/2016-18:41:10 BST:

Okay, the top two (as in the ones that should be grey and are instead white, haven't got a colour entry - so it happened between the PowerPoint and the json, NOT the json and the browser.

###### 01/10/2016-18:43:02 BST:

I've confirmed that the grey that works is exactly the same RGB (191*3) as the one that didn't.

###### 01/10/2016-18:43:26 BST:

So now what?

###### 01/10/2016-18:45:29 BST:

git checkout -b colourbug

###### 01/10/2016-18:46:17 BST:

running

./create.sh testinputs/CK20V2.pptx 5

to check the same behaviour works offline.

###### 01/10/2016-18:48:19 BST:

Okay, we get the same behaviour offline, so I'm going to add some debuging code.

###### 01/10/2016-18:50:31 BST:

Hmmm... There's an amzing number of exceptions in the colour section. Let's see if we can do some more debugin.

###### 01/10/2016-18:52:27 BST:

It turns out we get this exception:

TypeError: a transparent (background) fill has no foreground color

Which we've been swallowing for a while. It's talked about here:

http://python-pptx.readthedocs.io/en/latest/user/autoshapes.html

My working hypothosis is that, because I'm working thought *all* of the objects, I'm getting all of the text ones as well.

###### 01/10/2016-19:09:38 BST:

I'm doing some more debuging, getting NOTvery far. Hypothisis was wrong.

###### 01/10/2016-19:18:46 BST:

Okay, the exception is only being raised for rectanges. Not folder colours, and NOT picture. Le'ts try something silly.

###### 01/10/2016-19:23:09 BST:

I'm trying replacing the ones that fail in powerPOint, with the ones that work.

###### 01/10/2016-19:24:22 BST:

No dice. Still the same problem, even if I literally copy and paste a working one.

###### 01/10/2016-19:24:48 BST:

Let's try Just changing the target colour.

###### 01/10/2016-19:29:41 BST:

Oh - it might be that I was changing one file and using the other. Hang on. Something is happening.

###### 01/10/2016-19:32:52 BST:

Okay. Changing the tile on the PowerPoint template solved the problem. Which is great. My choice now is

* Work out what caused the problem and fix that.

* Write some code to detect missing colours and change *all* of the offending ones.

###### 01/10/2016-19:33:50 BST:

I suspect I'll go with option B But possibly tomorrow.

Discussions