ASML-Labs / PPTX.jl

Generate PowerPoint PPTX files from Julia
https://asml-labs.github.io/PPTX.jl/
MIT License
86 stars 7 forks source link

Add content types for picture formats #42

Closed jaakkor2 closed 1 year ago

jaakkor2 commented 1 year ago

Fix #28 and #32.

codecov[bot] commented 1 year ago

Codecov Report

Merging #42 (091a068) into main (53915bc) will increase coverage by 0.13%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main      #42      +/-   ##
==========================================
+ Coverage   94.47%   94.61%   +0.13%     
==========================================
  Files          10       10              
  Lines         507      520      +13     
==========================================
+ Hits          479      492      +13     
  Misses         28       28              
Files Changed Coverage Δ
src/write.jl 87.60% <100.00%> (+1.49%) :arrow_up:
matthijscox-asml commented 1 year ago

Excellent! Feel free to immediately version bump the Project.toml so we can release this fix. Else I'll just do it in a separate PR.

jaakkor2 commented 1 year ago

Done @matthijscox-asml .

hellemo commented 1 year ago

With v0.6.4 I get an error: ERROR: SystemError: opening file "../[Content_Types].xml": Permission denied

jaakkor2 commented 1 year ago

With v0.6.4 I get an error: ERROR: SystemError: opening file "../[Content_Types].xml": Permission denied

Which template are you using? Which OS?

Code creates a tmp directory and changes into ppt folder there. [Content_Types].xml should be at one directory level higher. https://github.com/ASML-Labs/PPTX.jl/blob/v0.6.3/src/write.jl#L153-L154

hellemo commented 1 year ago

This was without specifying any template, on linux (WSL on Win 10)

The exact same code worked on the previous release, so I figured it had to do with this change.

jaakkor2 commented 1 year ago

Weird, I do get the same error with ]add PPTX@0.6.4, but not if I ]dev PPTX. I am on Julia 1.10.0-beta1 on Windows.

matthijscox-asml commented 1 year ago

Wait, are you editing the template file directly (which is stored in .julia/packages, which is probably read-only)? Or maybe the path got pre-compiled into the code?

I propose to make the input ppt path a variable again (and to use abspath so we can see where it's located). Let me do try to do that right now.

Edit: I see @jaakkor2 is doing it already.

jaakkor2 commented 1 year ago

Putting @show pwd() into add_contenttypes! shows the temp directory pwd() = "C:\\Users\\jaakkor2\\AppData\\Local\\Temp\\jl_3DqpiT\\no-slides\\ppt

Why would CI pass?

matthijscox-asml commented 1 year ago

Hmm, if the path got compiled into the function upon the first run, then we should have still found out when the unit tests call PPTX.write the second time...