Comments (4)
Thank you @Boscop !
For google streetview images, I am not familiar with the format, but it looks like the kind of things that dezoomify-rs's generic dezoomer handles.
from serde-xml-rs.
I think this might be a duplicate of #3 .
This small example you have shown should definitely not require multiple GB of RAM
from serde-xml-rs.
@Boscop : Hello ! I know I am 3 years late, but I stumbled upon this issue, and it looks like you were trying to parse krpano description files in rust. I am the maintainer of dezoomify-rs, which also contains a (currently incomplete) implementation of the krpano xml format in rust. Can you tell a little bit more on what your project was at the time, and if you happen to still have an open-source implementation of a KRPano XML parser in rust ?
from serde-xml-rs.
@lovasoa Wow, I didn't know about dezoomify but it looks like a very cool project.
That project was about downloading 360° panorama/cubemap tiles and stitching them together, to be able to load them as cubemaps with glium like this.
I just looked at the code (that I haven't run since then, because I've been busy with other things, but at some point I might get back to it).
I vaguely remember that after I added explicit enum variants for all the cases that can occur, it worked.
These are the structs I ended up using, but they are incomplete as well, stuffing all the attributes into Vec<String>
s. Feel free to use this & build on this:
#[derive(Debug, Deserialize)]
struct KrPano {
#[serde(rename = "$value")]
items: Vec<KrPanoItems>,
}
#[derive(Debug, Deserialize)]
#[allow(non_camel_case_types)]
enum KrPanoItems {
panoview(Vec<String>),
view(Vec<String>),
autorotate(Vec<String>),
image(Image),
action(Vec<String>),
layer(Vec<String>),
}
#[derive(Debug, Deserialize)]
struct Image {
#[serde(rename = "type")]
typ: String,
multires: bool,
right: Side,
left: Side,
up: Side,
down: Side,
front: Side,
back: Side,
}
#[derive(Debug, Deserialize)]
struct Side {
url: String,
}
Btw, could you add support for downloading tiles from google streetview panoramas? :)
Some example code here:
https://github.com/Jam3/extract-streetview
https://github.com/Jam3/google-panorama-tiles/blob/master/index.js
E.g.
curl https://lh3.ggpht.com/-g13kt2ekmi8/Vi2AaAydWgI/AAAAAAAAIZY/Md1XU4d_2echRCFXuSf0RQCO4MKDS-FxACJkC/x[0-11]-y[0-5]-z4/p -o tile_#2-#1.jpg
montage -mode concatenate -tile 12x6 tile*.jpg pano.png
But depending on the size, it needs to be cropped:
curl https://lh3.ggpht.com/-4RiMhWapOug/WUHkWYAWSoI/AAAAAAAAcHw/bmNgAVEQCK8JRQtaMRUfVBismGPUbB5_ACLIBGAYYCw/x[0-11]-y[0-5]-z4/p -o tile_#2-#1.jpg
montage -mode concatenate -tile 12x tile*.jpg pano.png
mogrify -crop 5000x2500+0+0 pano.png
from serde-xml-rs.
Related Issues (20)
- LastElementNameNotAvailable error on writing HOT 11
- Decoding 0 elements in to a Vec gives "custom: missing field `$value`" error HOT 2
- Deserialization with custom deserializer does not work according to serde spec HOT 1
- Is there something like "from_slice"
- custom: missing field `id`
- Expose EmitterConfig/Make document declaration optional
- readme.md example broken out of the box
- readme.md example broken out of the box
- Can't serialize a struct with error 'LastElementNotAvailable'
- Error `DocumentStartAlreadyEmitted` while trying to serialize simple structure in 0.6.0
- Hoot serialize into attributes HOT 2
- Cannot add attribute id
- duplicate field `$value`'
- Does anyone have an improved fork or does any better alternative exist?
- You've found a bug in xml-rs, caused by calls to push_pos() in states that don't end up emitting events
- Regression : Fix xml-rs depencency version in Cargo.toml
- error order when serde a enum field
- Parse error whlist parsing hackernoon xml feed
- Enum/choice list does not work HOT 1
- Unable to Serialize vector struct HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from serde-xml-rs.