Commit 759ac336 authored by RazrFalcon's avatar RazrFalcon

(usvg) base64 updated.

parent 4bfe6a41
......@@ -32,11 +32,10 @@ dependencies = [
[[package]]
name = "base64"
version = "0.9.3"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
......@@ -530,11 +529,6 @@ dependencies = [
"xmlparser 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "safemem"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "simplecss"
version = "0.1.0"
......@@ -605,7 +599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "usvg"
version = "0.4.0"
dependencies = [
"base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libflate 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"lyon_geom 0.12.2 (registry+https://github.com/rust-lang/crates.io-index)",
......@@ -654,7 +648,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
"checksum arrayvec 0.4.9 (registry+https://github.com/rust-lang/crates.io-index)" = "d18513977c2d8261c448511c5c53dc66b26dfccbc3d4446672dea1e71a7d8a26"
"checksum atk-sys 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7017e53393e713212aed7aea336b6553be4927f58c37070a56c2fe3d107e489"
"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643"
"checksum base64 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "621fc7ecb8008f86d7fb9b95356cd692ce9514b80a86d85b397f32a22da7b9e2"
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
"checksum byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "94f88df23a25417badc922ab0f5716cc1330e87f71ddd9203b3a3ccd9cedf75d"
"checksum cairo-rs 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "dd940f0d609699e343ef71c4af5f66423afbf30d666f796dabd8fd15229cf5b6"
......@@ -702,7 +696,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum resvg-qt 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0c2efacc41fc639ff3bf9c02c923a69a1cff354ef4fffbb772be45fbfdeb7f30"
"checksum rgb 0.8.11 (registry+https://github.com/rust-lang/crates.io-index)" = "002bebda58b24482d6911a59512e8a17fa1defecf5a2162521113b7cc5422dd1"
"checksum roxmltree 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "869a77456372218c6cd28ae457bedbc338af19866290e71d71965cc992e2654b"
"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
"checksum simplecss 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "135685097a85a64067df36e28a243e94a94f76d829087ce0be34eeb014260c0e"
"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac"
"checksum slab 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5f9776d6b986f77b35c6cf846c11ad986ff128fe0b2b63a3628e3755e8d3102d"
......
......@@ -3,7 +3,7 @@
import argparse
import os
import platform
import subprocess as proc
import subprocess
from subprocess import run
from contextlib import contextmanager
from pathlib import Path
......@@ -76,7 +76,7 @@ if 'RESVG_QT_BACKEND' in os.environ:
try:
regression_testing('qt')
except proc.CalledProcessError:
except subprocess.CalledProcessError:
exit(1)
......@@ -90,7 +90,7 @@ if 'RESVG_CAIRO_BACKEND' in os.environ:
with cd('testing_tools/regression'):
try:
regression_testing('cairo')
except proc.CalledProcessError:
except subprocess.CalledProcessError:
exit(1)
......
......@@ -13,7 +13,7 @@ readme = "README.md"
workspace = ".."
[dependencies]
base64 = "0.9" # Do not update, because a lot of important code was removed.
base64 = "0.10"
libflate = "0.1"
log = "0.4"
lyon_geom = "0.12"
......
......@@ -259,7 +259,7 @@ fn convert_fe_image(
}
};
let (img_data, format) = match super::image::get_href_data(href, opt.path.as_ref()) {
let (img_data, format) = match super::image::get_href_data(&*fe.id(), href, opt.path.as_ref()) {
Some((data, format)) => (data, format),
None => {
return tree::FilterKind::FeImage(tree::FeImage {
......
......@@ -37,7 +37,7 @@ pub fn convert(
}
};
if let Some((data, format)) = get_href_data(href, opt.path.as_ref()) {
if let Some((data, format)) = get_href_data(&*node.id(), href, opt.path.as_ref()) {
parent.append_kind(tree::NodeKind::Image(tree::Image {
id: node.id().clone(),
transform,
......@@ -50,6 +50,7 @@ pub fn convert(
}
pub fn get_href_data(
element_id: &str,
href: &str,
path: Option<&path::PathBuf>,
) -> Option<(tree::ImageData, tree::ImageFormat)> {
......@@ -71,21 +72,15 @@ pub fn get_href_data(
}
};
let base_data = &href[(idx + 1)..];
let mut base_data = href[(idx + 1)..].to_string();
base_data.retain(|c| c != ' ');
let conf = base64::Config::new(
base64::CharacterSet::Standard,
true,
true,
base64::LineWrap::NoWrap,
);
if let Ok(data) = base64::decode_config(base_data, conf) {
if let Ok(data) = base64::decode(&base_data) {
return Some((tree::ImageData::Raw(data.to_owned()), format));
}
}
warn!("Invalid 'xlink:href' content.");
warn!("Image '{}' has an invalid 'xlink:href' content.", element_id);
} else {
let path = match path {
Some(path) => path.parent().unwrap().join(href),
......
......@@ -674,13 +674,6 @@ fn conv_image_data(
data: &ImageData,
format: ImageFormat,
) -> String {
let base64_conf = base64::Config::new(
base64::CharacterSet::Standard,
true,
true,
base64::LineWrap::Wrap(64, base64::LineEnding::LF),
);
match data {
ImageData::Path(ref path) => path.to_str().unwrap().to_owned(),
ImageData::Raw(ref data) => {
......@@ -692,8 +685,8 @@ fn conv_image_data(
ImageFormat::JPEG => d.push_str("jpg"),
ImageFormat::SVG => d.push_str("svg+xml"),
}
d.push_str(";base64,\n");
d.push_str(&base64::encode_config(data, base64_conf));
d.push_str(";base64, ");
d.push_str(&base64::encode(data));
d
}
......
......@@ -333,15 +333,15 @@ e-feGaussianBlur-009,bf0a0449
e-feGaussianBlur-010,cf71a03a
e-feImage-001,4623b513
e-feImage-002,5470c01d
e-feImage-003,6007495f
e-feImage-004,c4a34eba
e-feImage-003,2cd4b2bd
e-feImage-004,fe9870c6
e-feImage-005,6df5e8b1
e-feImage-006,08b0e7c8
e-feImage-007,a47f0830
e-feImage-008,f5ee0cad
e-feImage-009,40869c0a
e-feImage-010,e431b9a5
e-feImage-011,1f1c51d1
e-feImage-007,4721c1af
e-feImage-008,9f4aead9
e-feImage-009,f446e4bd
e-feImage-010,232fac2b
e-feImage-011,57a78171
e-feMerge-001,6986e818
e-feMerge-002,66ed3094
e-feOffset-001,185d3b9b
......@@ -416,27 +416,27 @@ e-g-001,2f5b8c7a
e-image-001,77e983af
e-image-002,68b66129
e-image-003,c4f98e50
e-image-004,d816b26a
e-image-005,b7f73b78
e-image-004,879162d3
e-image-005,e16fda24
e-image-006,4c5c779a
e-image-007,6479ffa6
e-image-008,4d7bb3b8
e-image-009,d816b26a
e-image-010,a8f77f37
e-image-011,861e054f
e-image-012,a762e721
e-image-013,b34c2210
e-image-014,be678522
e-image-015,e8771acf
e-image-016,0f71808a
e-image-017,8f958e1f
e-image-018,75d5aa3b
e-image-019,a0600765
e-image-020,d57c2c60
e-image-021,a7f8cee9
e-image-022,da70e77a
e-image-023,e9df2a52
e-image-024,cc9ee40e
e-image-007,500127fe
e-image-008,fe6e8287
e-image-009,879162d3
e-image-010,aac6446f
e-image-011,b04d96ed
e-image-012,f9384b16
e-image-013,4a7f782b
e-image-014,cc2ba863
e-image-015,447f0fc0
e-image-016,ae27ab09
e-image-017,9d7eab0c
e-image-018,4e9350d5
e-image-019,3e0aa750
e-image-020,87cae28f
e-image-021,3d232908
e-image-022,dd2f07b7
e-image-023,22928361
e-image-024,2180ed36
e-image-025,55f571ef
e-image-026,1108c4da
e-image-027,f5271765
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment