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

After file format conversion, thumbnail generation uses the wrong url #476

Open
shuhaowu opened this issue Jul 23, 2022 · 1 comment
Open

Comments

@shuhaowu
Copy link

This is a part of series of bugs that I've discovered while making a somewhat complex gallery with sigal.

This issue pertains to image file format conversion and thumbnail url generation. The example can be see in this repo.

In this case, we need to first workaround the problem outlined in #474 by adding the two lines into the plugins:

title = "Test Gallery"
source = "gallery"
theme = "photoswipe"

img_format = "JPEG"
img_size = (3000, 2000)
keep_orig = True

jpg_options = {
  'quality': 90,
  'optimize': True,
  'progressive': True,
}

plugins = [
  "PIL.PngImagePlugin",
  "PIL.JpegImagePlugin",
]

After this workaround is applied, the conversion works. However, if you have a sub album like this:

gallery
└── subgallery
    ├── index.md
    └── Untitled.png

where the index.md file looks like:

Title: Subgallery
Thumbnail: Untitled.png

The album.thumbnail property will be generated incorrectly with a .png extension instead of a .jpeg extensions. After building the above, we can look at the html and the thumbnail folder:

$ cat _build/index.html | grep thumb
    <div class="menu-img thumbnail">
        <img src="subgallery/thumbnails/Untitled.png" class="album_thumb"
$ ls -l _build/subgallery/thumbnails
total 4
-rw-rw-r-- 1 shuhao shuhao 482 Jul 23 17:17 Untitled.jpeg

This obviously results in issues with the generated gallery as the thumbnail for the album is broken. This occurs on all themes.

@saimn
Copy link
Owner

saimn commented Aug 2, 2022

Not ideal but you should just use the name of the generated thumbnail, ie. Untitled.jpeg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants