1 (edited by luf 2025-02-05 14:24:46)

Topic: SVG Datei mit einer Breite von über 10'000px exportieren.

Liebe Community

Ich habe ein gigantisches Singleline mit einer Breite von ca. 50'000px und einer Höhe von 2064px erstellt. Gerne würde ich das Singleline nun als SVG exportieren. Dabei stiess ich auf das Problem, dass maximal 10'000 px breit exportiert werden kann. Leider darf ich die Datei nicht in mehreren Teilen exportieren, das habe ich bereits getan, wurde aber so nicht akzeptiert. nomicons/sad

Ich denke um eine solche Datei exportieren zu können, müsste ich im Quellcode in der Datei "exportdialog.cpp" auf den Zeilen 1011 und 1016 die range von 10'000px auf 100'000px erhöhen. Was denkt ihr?

Github: https://github.com/qelectrotech/qelectr … .cpp#L1010

Ausserdem wäre meine Frage an die Admins, ob diese range auch im offiziellen Code von Q-Electrotech erhöht werden kann. (so dass auch meine Nachfolger grosse .qet-Datei bearbeiten und exportieren können.)

Unten habe ich noch ein Screenshot des erwähnten Codes und ein Screenshot des Exportierfensters in Q-Electrotech, in welchem die maximale Breite erreicht ist, angehängt.

Vielen Dank im voraus! nomicons/smile
Liebe Grüsse
Luf

Post's attachments

Attachment icon Export_Limite_10000px.png 11.86 kb, 15 downloads since 2025-02-05 

Attachment icon q-electrotech_width_and_height_limit.png 75.95 kb, 17 downloads since 2025-02-05 

2

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Hallo Luf,

Das sind ja mal große Dinge, die Du vorhast!   nomicons/shocked

Willst Du Dir eine Wandtapete mit QET gestalten? nomicons/wink

Einige Vorgaben in QET sind so enthalten, weil sich die Entwickler nicht vorstellen konnten, daß jemand irgendwas anderes (oder wie in diesem Fall) größeres braucht! Ob genau diese Anforderung auch dazugehört oder ob es echte technische Gründe für die Werte gibt, kann ich nicht sagen.

Deine Formulierung suggeriert mir, daß Du die Werte für Deine lokale Installation schon eingetragen und kompiliert hast. Ist das so?
Und: Funktioniert das?

Diese Anforderung macht natürlich neugierig:
In welcher Branche werden (Schalt-) Pläne auf einer einzelnen Seite auf dann auch noch als SVG benötigt oder gefordert?

Gruß
  plc-user

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

3 (edited by luf 2025-02-05 15:24:12)

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Hallo PLC User,

Ja sehr grosse Dinge xD Ich mache ein Industriepraktikum und habe den Auftrag ein Übersichtsschema des ganzen Stromnetzes mit Mittelspannung, Trafostationen, Hauptverteiler, Unterverteiler und Steuertableaus zu erstellen. Der Zweck ist u.a. die Wartung der Wartungspflichtigen Schalter zu vereinfachen.

Weil PDFs eine maximale Breite von 5 Meter haben, ( wusste ich auch nicht xD) möchte ich es gerne als SVG exportieren. Aber die ursprüngliche Idee für SVG kam, weil der PDF Export etwas buggy war, aber dieses habe ich vielleicht schon gelöst.

Und ich versuche es gerade anzupassen, aber ich habe noch nie ein git-hub Ordner zu einem Programm umgewandelt und kämpfe gerade hiermit... (Ich kenn mich Null aus mit C++ und noch noch weniger mit dem kompilieren eines ganzen Ordners voller C++ Dateien^^)

4 (edited by plc-user 2025-02-05 15:30:29)

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Hallo Luf,

bei QET und SVG sprechen wir in beiden Fällen von Vektor-Grafik! Also prima skalierbar! Deshalb wäre es schlecht, wenn Du Pixel-Bilder im Plan verwenden würdest!
Habe "gerade mal fix" einen QET-Export einer Folio auf 750x560px und nochmal auf 75000x56000px gemacht.
Wenn ich mir die beiden Dateien im Vergleich anschaue, sind dort "nur" andere Faktoren für "transform=matrix(..." angegeben.
O.k. - das sind ziemlich viele, aber die brauchst Du doch nicht händisch ändern: Dafür gibt es Inkscape!
Du exportierst also zunächst die QET-Datei so groß wie möglich und dann öffnest Du die SVG in Inkscape.
In den Dokument-Eignenschaften die Dokument-Größe auf die gewünschten Werte setzen und den Inhalt skalieren.
Ich kenne Deine Datei nicht, aber so wäre meine Vorgehensweise, solange Du die Sourcen von QET nicht selber kompilieren kannst.

EDIT: Hatte die Anhänge vergessen...

Gruß
  plc-user

Post's attachments

Attachment icon SVG-Export.zip 4.1 kb, 26 downloads since 2025-02-05 

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

5

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

... einen Anhang habe ich noch!

Post's attachments

Attachment icon Bildschirmfoto_2025-02-05_SVG-export.png 69.93 kb, 13 downloads since 2025-02-05 

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

6

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Werde ich gleich mal versuchen, vielen Dank! nomicons/smile

7

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Hello luf,
you want to print your project with these printers?: https://www.materiel-informatique.fr/7- … et-traceur
To print it 10 metres long by two metres wide?

I don't have this type of printer at home but I do at work, but i never used.
Here's how I'll do it, I'll adapt the QET title-block so that it's still in 4/3 format but with px dimensions of the order of 10,000 px 20X 600px on 10x800px that makes a very large work surface on the computer screen.

The official QET symbols will then be very small in the folio, so if you're working with a huge screen you should be able to put a lot of information on this plane.

You then need to re draw or enlarge the elements using plc-user's QET_elementScaler.

See this example attached.

Post's attachments

Attachment icon weneedpolonez-Polonez_MR89_wiring_diagram.zip 1.64 mb, 23 downloads since 2025-02-05 

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

8

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Wenn ich mir das so anhöre mit "PDF kann nur 5 m", "10m x 2m - Drucker" und  so:
Ich hätte gerne das Endergebnis gesehen!
In welche Kunsthalle / Galerie kommt das rein? nomicons/wink

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

9

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Back to the original question:

luf wrote:

Ich denke um eine solche Datei exportieren zu können, müsste ich im Quellcode in der Datei "exportdialog.cpp" auf den Zeilen 1011 und 1016 die range von 10'000px auf 100'000px erhöhen. Was denkt ihr?

Do you think there are technical reasons for the limits of 10.000px, Laurent?

As I wrote above, I created a local version on my Debian-box with the limits set to 100.000px and could export SVG with a width of

svg width="14882.6mm" height="11112.5mm"

see attachments in the post above: https://qelectrotech.org/forum/viewtopi … 993#p20993

Do you think it is possible to rise the limits in general?

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

10

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

@plc-user: I don't know for now, this code was writed since 16 years...

commit 4da7e54d75c048c456f5ee00b3888efdd0f3e434
Author: xavier <xavier@r991  xavier  2010-05-09 20:40:08 +0200 (dim. 09 mai 2010)>, Fri Apr 3 19:30:25 2009 +0000 (il y a 16 ans)
Committer: xavier <xavier@r991  xavier  2010-05-09 20:40:08 +0200 (dim. 09 mai 2010)>, Fri Apr 3 19:30:25 2009 +0000 (il y a 16 ans)
Branches: <Local>: master
          origin: 0.8.1, 0.9, 0.9.0, ..., terminal_strip_window, test_merge, test_pugi et 26 de plus
Precedes: 0.2a


Edit:


https://stackoverflow.com/questions/410 … png-images

The PNG specification doesn't appear to place any limits on the width and height of an image; these are 4 byte unsigned integers, which could be up to 4294967295. http://www.libpng.org/pub/png/spec/iso/ … tml#11IHDR

Actually, your statement about image size limits is incorrect. PNG doesn't technically use 32-bit unsigned integers; it uses 31-bit unsigned integers padded with an extra zero bit. This was done to accommodate languages which don't have unsigned integer types. The upper limit on image width or height is thus 2^31-1 or 2,147,483,647. –
DK.
CommentedMar 20, 2011 at 3:53

This reeks of a case for SVG.. anytime your file size gets that big it's time to think of vector vs raster.. SVG can draw many complex shapes with fractals and sprites too.. the size is infinite so you could draw it and scale it up to be the size of a billboard with zooming in and no loss of quality. –


What is the maximum size of a JPG image?
65,535×65,535 pixels

https://stackoverflow.com/questions/503 … itmap-file

PNG and JPEG have no explicit limit on file size, whereas BMP has a limit of 32K by 32K pixels


What I'm seeing is that it's only in BMP that this could cause a problem if the user exceeds the limit of 32K by 32K pixels.
But which now uses this old image format

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

11

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Merged, packages under construction.

It doesn't cost anything to change the limit of the spinBox, PCs have come a long way in terms of power over the last 15 years, as has software.

Edit: done!

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

12

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Salut Laurent !

According to the research you did (Thanks for that!), there are limitations of the dimensions

32767 x 32767 for BMP
65535 x 65535 for JPG

With these infos I added some code to set the limits according to the file-type, but kept the maximum for all other types at 100.000px

PR is on the way!

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

13

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Thanks  for your work  plc-user. nomicons/wink

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

14

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Salut Laurent !

The limitations for maximum image sizes do not have to be set from image-type specifications, but from limitations in QPainter!

Cite from Qt-docs:

(...) while coordinates greater than +/- 2^15 can be used, any painting performed with coordinates outside this range is not guaranteed to be shown (...)

That is true: images greater than 32767 show a black margin! 

That's why we need to set the maximum width and height of exports to pixel-images to 32767.
Sorry for inconvenience!
Already prepare a PR ... follows soon!

Post's attachments

Attachment icon Bildschirmfoto_2025-02-07_gimp_2-folio.png 76.67 kb, 8 downloads since 2025-02-07 

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

15

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Hallo plc-user,

Thanks for pointing that out, I didn't think to check the Qt documentation on the limitations of the QPainter..

"Le jour où tu découvres le Libre, tu sais que tu ne pourras jamais plus revenir en arrière..."Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !

16

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

Hello PLC-User and Scorpio,

OMG, thats so great what you have implemented :0 Thank you a lot!

To the suggestion of plc-user, why i did not simply scale the svg file, it is because (at least in microsoft visio) the font-size doesn't change at all or at least not proportionally to the rest. So I tried to change the source code as suggested and it worked nomicons/smile (I know you found it out much earlier and better then i did (: )

But so if I understand you right, there will soon be an update that enables the export of those huge files?
And anyways, thank you a lot! nomicons/smile

17

Re: SVG Datei mit einer Breite von über 10'000px exportieren.

luf wrote:

OMG, thats so great what you have implemented :0 Thank you a lot!

If we ever meet in real life: I'll have a cup of coffee!  nomicons/smile

luf wrote:

To the suggestion of plc-user, why i did not simply scale the svg file, it is because (at least in microsoft visio) the font-size doesn't change at all or at least not proportionally to the rest.

The company from Redmod has a "problem" with really open standards: As long as I know them, SVG is not supported (very well)!
That's why I suggested Open-Source-Software Inkscape

A colleague once started to ask: "With Inkscape, can I do ...?"
I interrupted him and said: "Yes!"
It turned out: It worked!  nomicons/smile

luf wrote:

But so if I understand you right, there will soon be an update that enables the export of those huge files?

Speaking of 0.10-dev: Export for large files is already available for some days now!

Fragen zu QET gehören in dieses Forum und werden nicht per PM beantwortet! – Questions regarding QET belong in this forum and will NOT be answered via PM! – Les questions concernant QET doivent être posées sur ce forum et ne seront pas traitées par MP !