Open davidperrenoud opened 10 years ago
From irasc...@gmail.com on July 10, 2011 01:06:23
Thanks for the well-documented bug report and straightforward test case.
The bug also exists on the pc. Preliminary suspicion is that the svg export is somehow confused by the push-button part.
Status: Accepted
Owner: irasc...@gmail.com
From irasc...@gmail.com on July 10, 2011 01:46:53
The pushbutton4lead part was missing a viewBox attribute. This is normally safe enough, but the part still had a "generated by illustrator" label. Even this is normally safe, but in this case all the internal coordinates had already been converted from illustrator's 72 dpi to the standard 90 dpi. On export, Fritzing was trying to compensate for "illustrator", so the part was being scaled up. The fix was to put in the correct viewBox attribute.
You can download the repaired part svg at http://fritzing.googlecode.com/svn/trunk/fritzing/parts/svg/core/schematic/pushbutton4lead.svg . Drop it into [fritzing folder]/parts/svg/core/schematic/.
Leaving this bug open, because there may be other such parts, and changing the summary to so indicate. Need to write a script looking for parts without the viewbox attribute.
Summary: Bug in exporting SVG from schematic (part missing viewBox)
Status: PartlyDone
From irasc...@gmail.com on July 10, 2011 02:17:12
Here's the list of SVGs without the viewbox attribute. They may still export correctly, but it needs to be checked. Bumping up the priority.
C:\Users\jonathan\fritzing2\parts\svg\contrib\pcb\Peppermill_Power_Board__a40e6dc7c979bcff.svg
C:\Users\jonathan\fritzing2\parts\svg\core\breadboard\basic_photo_transistor.svg C:\Users\jonathan\fritzing2\parts\svg\core\breadboard\GLCD_128x64.svg C:\Users\jonathan\fritzing2\parts\svg\core\breadboard\NetduinoMini.svg
C:\Users\jonathan\fritzing2\parts\svg\core\icon\555timericon.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\basic-diode.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\basic_fsr.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\basic_pbutton.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\basic_photo_transistoricon.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\basic_relay.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\basic_resistor.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\basic_servo.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\basic_toggle_switch.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\dc_motor.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\GLCD_128x64.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\lm358icon.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\optocoupler4n35_icon.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\plain_pcb.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\potentiometer.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\StepperMotor-_Bipolar__icon.svg C:\Users\jonathan\fritzing2\parts\svg\core\icon\StepperMotor-_Unipolar__icon.svg
C:\Users\jonathan\fritzing2\parts\svg\core\pcb\capacitor_ceramic_100mil.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\capacitor_ceramic_200mil.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\capacitor_tantalum_100mil.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\capacitor_tantalum_200mil.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\crystal_HC18.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\inductor_400mil.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_cap_tantal_A_3216.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_cap_tantal_B_3528.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_cap_tantal_C_6032.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_cap_tantal_D_7343.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_crystal_HC49.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_D2Pak.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_DPak.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_elko_0405.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_elko_0605.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_elko_1010.svg C:\Users\jonathan\fritzing2\parts\svg\core\pcb\SMD_pushbutton.svg
C:\Users\jonathan\fritzing2\parts\svg\core\schematic\555timerschematic.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\basic_transistor_npn.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\basic_transistor_pnp.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\fet_n.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\fet_p.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\GLCD_128x64.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\lm358_schematic.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\optocoupler4n35_schematic.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\reed_switch.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\servo_schematic.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\spdt-switch.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\StepperMotor-_Bipolar__schematic.svg C:\Users\jonathan\fritzing2\parts\svg\core\schematic\StepperMotor-_Unipolar__schematic.svg
C:\Users\jonathan\fritzing2\parts\svg\obsolete\breadboard\basic_resistor.svg C:\Users\jonathan\fritzing2\parts\svg\obsolete\pcb\LED-red-5mmpcb.svg C:\Users\jonathan\fritzing2\parts\svg\obsolete\pcb\peltier_sensor.svg C:\Users\jonathan\fritzing2\parts\svg\obsolete\pcb\StepperMotor-_Bipolar__pcb.svg C:\Users\jonathan\fritzing2\parts\svg\obsolete\pcb\StepperMotor-_Unipolar__pcb.svg
Cc: andre.knoerig@gmail.com
Labels: -Priority-Medium Priority-High
From irasc...@gmail.com on July 17, 2011 05:04:05
Labels: Component-Export
From irasc...@gmail.com on August 28, 2011 23:06:57
Owner: andre.knoerig@gmail.com
Cc: -andre.knoerig@gmail.com
Could you explain in more details please what is missing?
Our part is available here: http://z-uno.z-wave.me/files/z-uno/pinout/Z-Uno%202-04.04.2016-16.57.fzpz It also disappears on SVG export
There are still parts without the viewBox element in the core, but this issue should be moved to the parts repository. The issue #835 addresses the checking for this attribute before adding a part to the core. Or should we try to change the code to make the viewBox attribute optional?? It is optional in svgs and I am not sure what is the strategy that we are trying to implement (be complaint with svg images or have a svg editor for Fritzing and not allow svgs created with external programs).
I think the viewbox is the only place where dimensions like mm or inches and a scale can be set. So, without the viewbox, Fritzing has to guess the size of a 'unit' in the svg. For this, it uses unreliable information, like the comment Illustrator puts into the header.
This issue causes quite some frustration to users when carefully designed graphics show up at the wrong scale. I think Fritzing should warn about those parts and ask for dpi , for example when a part that lacks proper information is added to the bin, and the parts editor should guide users to add proper scale.
OK, I see. But the issue of this thread should be clarified. There are a few things:
The only thing remaining is to check for this when importing a part into Fritzing. I would create a import assitant to fix the part before adding into the bin and which is triggered if the imported part misses the viewbox attribute. If we allow the part to be imported (to fix it later) there are a lot of chances that the part will not be fixed... However, there this is just a part of a bigger issue, as there are other things to check ( #1252 for example, but there are others). Not sure if should group all of them, or create a master issue that points to the other issues to fix in this import dialog/assistant.
From a...@randomsmiths.com on July 09, 2011 22:06:52
What steps will reproduce the problem? 1. Load attached file
Attachment: pullupcircuit.fz pullupcircuit_schem.svg
Original issue: http://code.google.com/p/fritzing/issues/detail?id=1555