xRyul / obsidian-image-converter

⚡️ Convert and compress images from one format to another by drag'n'dropping or pasting files into the note.
MIT License
111 stars 11 forks source link

[QUESTION] Is there a way to include subfolder in the file location? #14

Closed lduperval closed 7 months ago

lduperval commented 7 months ago

Hi,

Is there a way to include the subfolder in the name of the file for compatibility purposes? For examples, if I ask to put the file in the "images" subfolder, the file is stored there but the Markdown does not include the subfolder name. So if I open the file in a different app, the contnt is missing.

Thanks,

L

xRyul commented 7 months ago

Just for clarification, lets assume if I drop "image.jpg" into note called "MySampleNote.md":

Various options for file renaming are in the roadmap, although can't provide exact date right now

lduperval commented 7 months ago

HI,

No, not quite.

If I have an image called: doctor-listening-to-patient-heart.jpg

I want the file to be named

images/doctor-listening-to-patient-heart-YYYYMMDD.webp

where YYYYMMDD is not necessarily important. But the doctor-listineng-to-patient part is because it contains semantic information.

L

xRyul commented 7 months ago

Thanks for the clarification. Should be possible to implement this, although not sure about forward slash “/”, Obsidian doesnt allow certain special characters to be used in the name e.g “/\:” are not allowed, hence most likely would need to use “-” or “underscore” instead.

Gonna have to investigate it further

On Mon, 2 Oct 2023 at 14:19, lduperval @.***> wrote:

HI,

No, not quite.

If I have an image called: doctor-listening-to-patient-heart.jpg

I want the file to be named

images/doctor-listening-to-patient-heart-YYYYMMDD.webp

where YYYYMMDD is not necessarily important. But the doctor-listineng-to-patient part is because it contains semantic information.

L

— Reply to this email directly, view it on GitHub https://github.com/xRyul/obsidian-image-converter/issues/14#issuecomment-1743004572, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALJFUBXESWA3RBANG33JVWDX5K5PXAVCNFSM6AAAAAA5H6B2MCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBTGAYDINJXGI . You are receiving this because you commented.Message ID: @.***>

lduperval commented 7 months ago

Actually, the "images/" is not part of the name. It's the folder specified in the config. It could be anything.

Thanks!

L

xRyul commented 7 months ago

I think I finally got it 😅

doctor-listening-to-patient-heart.jpgdoctor-listening-to-patient-heart.webp

  1. To preserve the original name you can simply turn off: Auto rename
  2. If images/ doesn't have to be in the name, you can put the image into images/ subfolder via: a) "Output" -> "In the folder specified below:" then type in "/images". This will allow you to store all images inside this folder, regardless in which note they are located. b) "Output" -> "In subfolder under current folder" then type in "/images". If you have many folders in Obsidian, and each folder represents a category/project, then this option might be great for you. It will create a subfolder under current note, or if the note is inside the folder, then it will create subfolder inside this folder. Thus essentially allowing your images to follow your "projects".

https://github.com/xRyul/obsidian-image-converter/assets/47340038/b7aa521f-4d19-4b4d-b00b-243cab65ad24

lduperval commented 7 months ago

Oh, that's simpler than I thought! Thanks!

lduperval commented 7 months ago

Hi again,

I have another question. Above you say that if "images/" doesn't have to be in the name I have a couple of options. But what if I do want "images" to be part of the name (which is what I want for compatibility with other editors)?

Thanks!