Discussion:
[Geotools-devel] [JIRA] (GEOT-5754) Support data uris as external graphics
Andreas Schmitz (JIRA)
2017-06-07 09:04:47 UTC
Permalink
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Andreas Schmitz
2017-06-07 09:13:17 UTC
Permalink
Andreas Schmitz (JIRA) wrote:

Hi everyone,
Assignee: Unassigned
Components: main
Created: 07/Jun/17 11:04 AM
Priority: [7]Medium Medium
Reporter: [8]Andreas Schmitz
I'd like to implement support for data uris to be used as external
graphics. This would allow for icons/markers to be included directly in
the style.
I've prepared a preliminary pull request:

https://github.com/geotools/geotools/pull/1617

Any thoughts?

Best regards, Andreas
Andrea Aime
2017-06-07 09:39:28 UTC
Permalink
HI Andreas,
thanks for following up on list.

What you added there seems to be pretty close to this, part of the SLD 1.1
specification (and supported, but only if the style is written in SLD 1.1):
https://github.com/geotools/geotools/blob/master/modules/library/render/src/test/resources/org/geotools/renderer/lite/test-data/base64.sld

The difference I see is that what you suggest would also work with SLD 1.0,
and would put the long string inside an XML attribute (the href one),
making it similar to what can be already done in, say, browsers with an IMG
tag.
Is that right?

Cheers
Andrea
Post by Andreas Schmitz
Hi everyone,
Assignee: Unassigned
Components: main
Created: 07/Jun/17 11:04 AM
Priority: [7]Medium Medium
Reporter: [8]Andreas Schmitz
I'd like to implement support for data uris to be used as external
graphics. This would allow for icons/markers to be included directly
in
the style.
https://github.com/geotools/geotools/pull/1617
Any thoughts?
Best regards, Andreas
------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
GeoTools-Devel mailing list
https://lists.sourceforge.net/lists/listinfo/geotools-devel
--
==
GeoServer Professional Services from the experts! Visit
http://goo.gl/it488V for more information.
==

Ing. Andrea Aime
@geowolf
Technical Lead

GeoSolutions S.A.S.
Via di Montramito 3/A
55054 Massarosa (LU)
phone: +39 0584 962313
fax: +39 0584 1660272
mob: +39 339 8844549

http://www.geo-solutions.it
http://twitter.com/geosolutions_it

*AVVERTENZE AI SENSI DEL D.Lgs. 196/2003*

Le informazioni contenute in questo messaggio di posta elettronica e/o
nel/i file/s allegato/i sono da considerarsi strettamente riservate. Il
loro utilizzo Ú consentito esclusivamente al destinatario del messaggio,
per le finalità indicate nel messaggio stesso. Qualora riceviate questo
messaggio senza esserne il destinatario, Vi preghiamo cortesemente di
darcene notizia via e-mail e di procedere alla distruzione del messaggio
stesso, cancellandolo dal Vostro sistema. Conservare il messaggio stesso,
divulgarlo anche in parte, distribuirlo ad altri soggetti, copiarlo, od
utilizzarlo per finalità diverse, costituisce comportamento contrario ai
principi dettati dal D.Lgs. 196/2003.



The information in this message and/or attachments, is intended solely for
the attention and use of the named addressee(s) and may be confidential or
proprietary in nature or covered by the provisions of privacy act
(Legislative Decree June, 30 2003, no.196 - Italy's New Data Protection
Code).Any use not in accord with its purpose, any disclosure, reproduction,
copying, distribution, or either dissemination, either whole or partial, is
strictly forbidden except previous formal approval of the named
addressee(s). If you are not the intended recipient, please contact
immediately the sender by telephone, fax or e-mail and delete the
information in this message that has been received in error. The sender
does not give any warranty or accept liability as the content, accuracy or
completeness of sent messages and accepts no responsibility for changes
made after they were sent or for other risks which arise as a result of
e-mail transmission, viruses, etc.

-------------------------------------------------------
Andreas Schmitz
2017-06-07 09:50:07 UTC
Permalink
Andrea Aime wrote:

Hi Andrea,
Post by Andrea Aime
thanks for following up on list.
What you added there seems to be pretty close to this, part of the SLD 1.1
https://github.com/geotools/geotools/blob/master/modules/library/render/src/test/resources/org/geotools/renderer/lite/test-data/base64.sld
The difference I see is that what you suggest would also work with SLD 1.0,
and would put the long string inside an XML attribute (the href one),
making it similar to what can be already done in, say, browsers with an IMG
tag.
Is that right?
yes, that's true. Another case when this comes in handy is when you
create external graphic styles programmatically, since the inline
content stuff is not contained in the interface but only in the
ExternalGraphicImpl.

That's actually my use case, I'm trying to add support for data uris
in MapFish's json styles.

Best regards, Andreas
Ben Caradoc-Davies
2017-06-12 23:58:32 UTC
Permalink
Are there any security considerations?
I'd like to implement support for data uris to be used as external
graphics. This would allow for icons/markers to be included directly in
the style.
--
Ben Caradoc-Davies <***@transient.nz>
Director
Transient Software Limited <http://transient.nz/>
New Zealand
Andreas Schmitz
2017-06-13 05:37:36 UTC
Permalink
Ben Caradoc-Davies wrote:

Hi,
Post by Ben Caradoc-Davies
Are there any security considerations?
I don't think so. The data uris contain the bytes that would be loaded
over the network in the case of 'classical' urls as a base64
string. Nothing else is changed, the same restrictions that apply to
external urls also apply to data uris.

Best regards, Andreas

Loading...