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

Resized images get deleted #6

Open
nibynool opened this issue Jan 20, 2019 · 2 comments
Open

Resized images get deleted #6

nibynool opened this issue Jan 20, 2019 · 2 comments

Comments

@nibynool
Copy link

Quick Summary

When i run hexo clean;hexo generate everything works. Subsequent runs of hexo generate delete the generated image files.

Details

I've configured the plugin as follows:

# Configuration for hexo-image-sizes
image_sizes:
  pattern: !!js/regexp /\.(gif|jpg|jpeg|png)$/i
  profiles:
    body:
      width: 700 # height will adjust to preserve aspect ratio
    sm-body:
      width: 400
    sq-thumbnail:
      width: 100 # Image will be cropped to a square
      height: 100
    huge:
      height: 1000
      allowEnlargement: true
  defaultProfile: body
  link: true
  linkProfile: huge
  useAltForTitle: true

Within my post I have the following code:

{% imsize %}
src: /images/20190119/laptop-specs.png
alt: Apple Macbook Pro specs
title: Apple Macbook Pro specs
profile: sm-body
link: false
{% endimsize %}

When I run hexo clean;hexo generate everything works and I get the following output:

INFO  Deleted database.
INFO  Deleted public folder.
INFO  Start processing
INFO  Files loaded in 309 ms
INFO  Generated: sitemap.xml
INFO  Generated: atom.xml
INFO  Generated: index.html
INFO  Generated: tags/index.html
INFO  Generated: categories/index.html
INFO  Generated: archives/index.html
INFO  Generated: img/bg-pattern.png
INFO  Generated: archives/2019/01/index.html
INFO  Generated: categories/Development/macOS/index.html
INFO  Generated: archives/2019/index.html
INFO  Generated: categories/Development/index.html
INFO  Generated: images/20190119/sm-body-laptop-specs.png
INFO  Generated: css/style.css
INFO  Generated: js/main.js
INFO  Generated: images/20190119/sm-body-desktop-specs.png
INFO  Generated: categories/Development/macOS/Software/Hardware/index.html
INFO  Generated: categories/Development/macOS/Software/index.html
INFO  Generated: images/20190119/laptop-specs.png
INFO  Generated: images/20190119/desktop-specs.png
INFO  Generated: 2019/01/20/hexo-serverless/index.html
INFO  Generated: 2019/01/19/development-environment/index.html
INFO  21 files generated in 387 ms

When I then run hexo generate the resized images are deleted and my post no longer contains the images. Here's the output:

INFO  Start processing
INFO  Files loaded in 167 ms
INFO  Deleted: images/20190119/sm-body-desktop-specs.png
INFO  Deleted: images/20190119/sm-body-laptop-specs.png
INFO  0 files generated in 218 ms
@ottobonn
Copy link
Owner

Is this still broken for you? I have noticed that sometimes images disappear for me too if I don't clean and generate. I can investigate further.

@dantler
Copy link
Contributor

dantler commented Oct 14, 2020

This is broken for me, too. I always clean and generate.

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

3 participants