Repository: flxzt/rnote (language: rust)

Issue:
Failing to copy to clipboard large files
**Describe the bug**  
Large images (svg and png) will fail to be copied to the clipboard if they are too large (~ 4 Mo is already too much)

**To Reproduce**  
Steps to reproduce the behavior:
1. paste a large image in a rnote document
2. try to copy it
3. try to paste it
5. See that the image is not pasted

**Expected behavior**  
Have the image be copied to the clipboard

**Console Output**  

```
read stream to rsvg loader failed.
```
or 
```
reading stream to rsvg loader failed.
```

**Desktop (please complete the following information):**  
 - OS: Mac os Sonoma
 - App Version: main commit 1fcb566
 - Installation Source: compile from source

**Additional context**  

This is a limitation of `librsvg` if the loader is not called with an unlimited size, see here : https://gitlab.gnome.org/GNOME/librsvg/-/issues/819

So calling 
```rs
rsvg::Loader::new()
            .with_unlimited_size(true)
```
instead of 
```rs
rsvg::Loader::new()
```
fixes the issue.




Discussion / hints:

Fix patch:
diff --git a/AUTHORS b/AUTHORS
index 641fc2e879..afeb6efa87 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -3,4 +3,5 @@ Felix Zwettler
 Seio Inoue
 Moritz Mechelk
 PhilProg
-Silvan Schmidt
\ No newline at end of file
+Silvan Schmidt
+Doublonmousse
\ No newline at end of file
diff --git a/crates/rnote-engine/src/render.rs b/crates/rnote-engine/src/render.rs
index 67f2772db3..a9a51abeea 100644
--- a/crates/rnote-engine/src/render.rs
+++ b/crates/rnote-engine/src/render.rs
@@ -525,6 +525,7 @@ impl Svg {
         );
         let stream = gio::MemoryInputStream::from_bytes(&glib::Bytes::from(svg_data.as_bytes()));
         let handle = rsvg::Loader::new()
+            .with_unlimited_size(true)
             .read_stream(&stream, None::<&gio::File>, None::<&gio::Cancellable>)
             .context("reading stream to rsvg loader failed.")?;
         let renderer = rsvg::CairoRenderer::new(&handle);
@@ -581,6 +582,7 @@ impl Svg {
                 gio::MemoryInputStream::from_bytes(&glib::Bytes::from(svg_data.as_bytes()));
 
             let handle = rsvg::Loader::new()
+                .with_unlimited_size(true)
                 .read_stream::<gio::MemoryInputStream, gio::File, gio::Cancellable>(
                     &stream, None, None,
                 )


Test patch: