-
Notifications
You must be signed in to change notification settings - Fork 59
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
Names of images in markdown #49
Comments
Yes, that's a good suggestion. I can change the way the image link is output. It is possible to save the image files, but that requires excessive permissions. |
excessive permissions would be bad, I agree and thanks for considering the change. |
+1 on changing the name. it will indeed make the mapping much much easier |
I can easily change the name. However, the order of the images in the zip file is not the same as the order in the Google Doc. So there may be some manual rejiggering required, unless there's some obvious but as-yet undiscovered scheme for ordering the images in the zip file. |
Hi, this seems a great addon, but for me to be useful I need the original images (the path can just be the original one pointing to google server) |
As of today's update (1.0β25), the image path is now in the form images/image1.png, images/image2.jpg, etc. However, beware that the exported zip file from Google Docs does not always have the images in the same order, so you'll still need to check that the images are referenced in the correct place in your converted doc. There does not seem to be any rhyme nor reason about the order in the exported zip file that you get from Download > Web Page. |
fyi I'm 90% sure that the order of the exported images is the same with the order that they been added to the docs.. not sure if there is something you can do about though |
I wish this were so, but I just tested it again: I added 4 images, and they came out in the zip file as image1, image2, image4, image3. I've only done a few experiments, but each time I've seen them come out in a different order than they appear in the doc (and in this case, I made sure to add them in that order, top to bottom of the doc). So, it looks like you'll still need to proofread the doc to make sure you get the images in the right spots. |
oooh. it just looks so weird that google has enforced no order in that.. anyway thanks for spending time on it |
This issue should be open. |
If you find out the scheme that Google uses to name the images (it's not the order in the Doc), let me know and we can fix that. Otherwise, I don't know of any way to guarantee that the image names correspond to the correct images as Google exports them into the zip file. |
Reopening in hopes that Google will (someday) export the images in a reproducible order. |
Thanks for reopening. I don't think Google cares about this. Random order is probably side effect of some optimization. In your gdc.handleImage function add inline image blobs inside of a global array i.e.:
Then after everything is done, create a ZIP file and save to Drive i.e.:
Also, I wonder if just setting |
The original version of this did export images to a zip file stored in Drive, but it requires very intrusive permssions (read all Drive files, write to Drive) that most people do not want to grant to an add-on. So I'm not planning to do that. It would be possible to do in a separate add-on, but it would still require lots of permissions. I will check out your suggestion that imgBlob.setName might affect Google's export to name the files in the correct order (though I doubt it). |
Hi. thanks for working on this :)
When you export to HTML from google docs, they name the files image1.jpg, image2.jpg etc.
We get a nice folder of images.
If you output ![images/image1.jpg] - etc instead of title + index + jpg, it would make life a lot easier when mapping image files.
we could simply copy the folder into the relative path and it should work.
if you then suppress all the error warning, it would help us make this process a bit cleaner..
what do you think?
The text was updated successfully, but these errors were encountered: