Skip to content

Make 'image' crate optional#764

Merged
bokuweb merged 1 commit intobokuweb:mainfrom
xamgore:image
Oct 22, 2024
Merged

Make 'image' crate optional#764
bokuweb merged 1 commit intobokuweb:mainfrom
xamgore:image

Conversation

@xamgore
Copy link
Contributor

@xamgore xamgore commented Oct 21, 2024

Discussion at #763.

#[derive(Debug, Clone, Serialize)]
#[serde(rename_all = "camelCase")]
pub struct Docx {
   ...
    // reader only
    pub images: Vec<(String, String, Image, Png)>,
}

Is Png really needed here? Why not just Image? The end user may convert buffer themselves…

@bokuweb
Copy link
Owner

bokuweb commented Oct 22, 2024

Is Png really needed here? Why not just Image? The end user may convert buffer themselves…

I wanted to convert TIFF to PNG using WebAssembly for use with docx-wasm in the browser (This is because browsers don't support tiff), but at least for native usage, the Image crate works well. It seems that I can reconsider the approach for WebAssembly as well.

Copy link
Owner

@bokuweb bokuweb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bokuweb bokuweb merged commit bf5ccac into bokuweb:main Oct 22, 2024
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

Successfully merging this pull request may close these issues.

2 participants