ebullient / ttrpg-convert-cli

Utility to convert JSON data (for content you own) from 5etools or pf2etools into Obsidian-friendly Markdown.
https://www.ebullient.dev/projects/ttrpg-convert-cli/
Apache License 2.0
174 stars 37 forks source link

🐛 Loading Local images from Mirror Repo impossible due to wrong file extension #353

Closed NEmbgen closed 6 months ago

NEmbgen commented 6 months ago

A clear and concise summary of what the bug is. Include the name/source of the badly rendered note, if applicable.

As described in the README, I want to be able to copy all images into my Obsidian Files by adding this snippet to the CLI config:

...,
"images" : {
    "internalRoot": "5etools-img",
    "copyInternal" : true,
    "copyExternal" : true
},
...

This is the error that is logged.

Unable to copy image from [...]\ttrpg-convert-cli-2.3.3-windows-x86_64\bin\5etools-img\adventure\WDH\Zhent-Warehouse-Upper-Players.jpg to Compendium\adventures\waterdeep-dragon-heist\img\zhent-warehouse-upper-players.jpg (java.nio.file.NoSuchFileException: [...]\ttrpg-convert-cli-2.3.3-windows-x86_64\bin\5etools-img\adventure\WDH\Zhent-Warehouse-Upper-Players.jpg)

The problem is, that all images in the Image Repo are .webp files while the CLI is looking for .jpg. This also happens without cloning the image repository.

Configuration

Sources:

{
  "from": ["WDH"],
  "paths": {
    "compendium": "/Compendium/",
    "rules": "/Rules/"
  },
  "images": {
    "internalRoot": "5etools-img",
    "copyInternal": true,
    "copyExternal": true
  },
  "template": {},
  "useDiceRoller": true,
  "tagPrefix": "",
  "full-source": {
    "book": [],
    "adventure": ["WDH"]
  }
}
ebullient commented 6 months ago

Are you sure you are using the right 5etools data?

git clone --depth 1 https://github.com/5etools-mirror-2/5etools-mirror-2.github.io.git

All images were changed to webp in the mirror-2 repository. You're seeing jpg images, which suggests your data is from mirror-1.

NEmbgen commented 6 months ago

That was it, I was following an old tutorial. Thank you!