epub validator "Duplicate ID" image error

User avatar
ighulme
Posts: 86
Joined: Sat Oct 25, 2014 12:55 pm
Platform: Mac + Windows
Contact:

Wed Jan 03, 2018 12:48 pm Post

Hi,
I originally posted this problem in the Tech Support section here:
http://www.literatureandlatte.com/forum/viewtopic.php?f=2&t=49946&p=256311

It seems like something that could do with fixing, so I thought I'd make a note of it in the bug section.

When trying to validate my epub file at http://validator.idpf.org/ I get the error messages for my images:

Error while parsing file 'Duplicate ID 's1.png''.

In the compiled html file I can see that each separator image is given the same attribute: "id=s1.png", instead of being unique, which causes errors.

I am adding them within the text by using placeholders: <$IMG: /path/to/file/Images/s1.png;W=300>

I tried to update to 3.01 in the hope of fixing this, but it seems that the only change is that the file extension has been removed from the id, but I still get errors for duplicate id's withing the same html file.

The 3.01 update also introduced an error in the Table of contents, whereby the title is now given a paragraph attribute, which also causes an error in the epub validator. But this appears to be a problem other users have come across with a workaround here: http://literatureandlatte.com/forum/viewtopic.php?p=255893#p255893

I am trying to get my epubs accepted on Smashwords Premium, but unfortunately they get rejected if they won't validate.
I G HULME
The Heavenfield: http://www.heavenfield.com

User avatar
KB
Site Admin
Posts: 19298
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Fri Jan 05, 2018 7:13 pm Post

The ToC issue is fixed for 3.0.2. Could you please send me a sample project showing the duplicate IDs issue? This works fine for me, so there must be something in the way it's set up that is different.
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
ighulme
Posts: 86
Joined: Sat Oct 25, 2014 12:55 pm
Platform: Mac + Windows
Contact:

Sat Jan 06, 2018 12:04 pm Post

Hi Keith,

thanks for your reply, and great to hear that the TOC issue has been fixed.

I've sent a project into Tech support with the files that are failing the validator.

I have been adding the same image multiple times, directly into the text using placeholders:

<$Img:/path/to/file/imagename.png;w=300>

Perhaps that is causing problems?

Many thanks,
Ian
I G HULME
The Heavenfield: http://www.heavenfield.com

User avatar
KB
Site Admin
Posts: 19298
Joined: Tue Jun 13, 2006 11:23 pm
Platform: Mac
Location: Truro, Cornwall
Contact:

Tue Jan 09, 2018 12:43 pm Post

Thanks, Ian. Yes, it seems that adding the image using the <$img> tag when the image is part of the project works okay, but when the image is stored externally, images end up using the same ID. The fact that they use the same ID is intentional as it goes through MultiMarkdown first, but as this is causing problems for epub validation I have fixed this so that images use unique IDs no matter what in 3.0.2.

All the best,
Keith
"You can't waltz in here, use my toaster, and start spouting universal truths without qualification."

User avatar
ighulme
Posts: 86
Joined: Sat Oct 25, 2014 12:55 pm
Platform: Mac + Windows
Contact:

Tue Jan 09, 2018 12:56 pm Post

That's brilliant, thanks Keith!

Look forward to the update. :)
I G HULME
The Heavenfield: http://www.heavenfield.com