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

Images Resize #63

Open
nicolasdamians opened this issue Dec 13, 2024 · 6 comments
Open

Images Resize #63

nicolasdamians opened this issue Dec 13, 2024 · 6 comments
Labels
bug Something isn't working upstream

Comments

@nicolasdamians
Copy link

nicolasdamians commented Dec 13, 2024

While exporting using template 'eisvogel' all the images gets resized, even if they are small or big. See attached
imagen

@noraj
Copy link
Owner

noraj commented Dec 14, 2024

Can you paste the associated markdown code?

@ndamian10
Copy link

Attaching some images too
imagen
imagen 1
imagen 2
imagen 3

@scamwork
Copy link

Same problem here

@noraj
Copy link
Owner

noraj commented Dec 21, 2024

See upstream issue, you need to either use an older version of eisvogel template as a workaround (2.4.2 or before, not latest 2.5.0), or for a proper fix to upgrade to a newer version of pandoc (3.2.1+, best 3.6.0).

The issue is nor OSERT, nor pandoc, nor eisvogel template, but Jurassic Linux Museum OS Debian, Ubuntu, Fedora or even ArchLinux have old versions of Pandoc previous to 3.2.1.

So download a newer bundle of pandoc: https://github.com/jgm/pandoc/releases

@noraj noraj added upstream bug Something isn't working labels Dec 21, 2024
Repository owner deleted a comment from nicolasdamians Dec 21, 2024
@nicolasdamians
Copy link
Author

Thanks @noraj , l'll test and update this comment, in the meantime for the others in case it's useful:

❯ wget https://github.com/jgm/pandoc/releases/download/3.6/pandoc-3.6-1-amd64.deb
--2024-12-21 12:53:29--  https://github.com/jgm/pandoc/releases/download/3.6/pandoc-3.6-1-amd64.deb
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/571770/6652c4fe-ec13-4769-b437-eee96f1068a4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241221%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241221T115331Z&X-Amz-Expires=300&X-Amz-Signature=27331e2beb7b2166ec3e9bef18909f8cff60ca6e305f97d73d14ae1528796732&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dpandoc-3.6-1-amd64.deb&response-content-type=application%2Foctet-stream [following]
--2024-12-21 12:53:31--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/571770/6652c4fe-ec13-4769-b437-eee96f1068a4?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=releaseassetproduction%2F20241221%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20241221T115331Z&X-Amz-Expires=300&X-Amz-Signature=27331e2beb7b2166ec3e9bef18909f8cff60ca6e305f97d73d14ae1528796732&X-Amz-SignedHeaders=host&response-content-disposition=attachment%3B%20filename%3Dpandoc-3.6-1-amd64.deb&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.108.133, 185.199.110.133, 185.199.109.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.108.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 32248406 (31M) [application/octet-stream]
Saving to: ‘pandoc-3.6-1-amd64.deb’

pandoc-3.6-1-amd64.deb                          100%[======================================================================================================>]  30.75M  57.7MB/s    in 0.5s    

2024-12-21 12:53:37 (57.7 MB/s) - ‘pandoc-3.6-1-amd64.deb’ saved [32248406/32248406]

❯ sudo dpkg -i pandoc-3.6-1-amd64.deb
(Reading database ... 932299 files and directories currently installed.)
Preparing to unpack pandoc-3.6-1-amd64.deb ...
Unpacking pandoc (3.6-1) over (3.1.11.1+ds-2) ...
Setting up pandoc (3.6-1) ...
Processing triggers for kali-menu (2023.4.7) ...
Processing triggers for man-db (2.12.0-3) ...
❯ pandoc -v
pandoc 3.6
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /home/kali/.pandoc
Copyright (C) 2006-2024 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.

@nicolasdamians
Copy link
Author

Hi @noraj ,

I confirm that after updating to pandoc 3.6 issue about resize is resolved.

On the other hand it was pretty challenging with the following scenario
1- Notes taken with Notion
2- Exported to .md
3- Kali 2024.02

Issues found so far:

  • .md contains characters not supported
  • export of notion contains .webp images
  • export of notion contains spaces between folders and files

Probably this should go into a separate section.

Some Work Arounds:

sed -i 's/■/*/g; s/✅/+/g; s/💡/!/g' M72.md\n
sed 's/─/-/g; s/㉿/X/g; s/└/\\/g; s/┌/\\\//g; s/■/[■]/g; s/❯/>/g' M7.md > M72.md\n
______
import os

def rename_images(directory):
    for filename in os.listdir(directory):
        if ' ' in filename:  # check if the filename contains spaces
            new_filename = filename.replace(' ', '_')  # replace spaces with underscores
            os.rename(os.path.join(directory, filename), os.path.join(directory, new_filename))
            print(f'Renamed: {filename} -> {new_filename}')

# Specify the directory where the images are stored
rename_images('M7')

Probably there are more I can't remember, but repeating this process every time is not trivial or straightforward. Let me know if you are interested in the .md export from Notion, happy to share.

Thanks a lot for your support and for this great tool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working upstream
Projects
None yet
Development

No branches or pull requests

4 participants