LinwoodDev / Butterfly

🎨 Powerful, minimalistic, cross-platform, opensource note-taking app
https://butterfly.linwood.dev
GNU Affero General Public License v3.0
981 stars 67 forks source link

[Enhancement]:In export SVG: try to reduce file size && improve performance #620

Closed HusniMuhammad closed 7 months ago

HusniMuhammad commented 7 months ago

Which feature is your request related to?

Export svg

Describe your request for enhancements!

In export SVG: reduce file size && improve performance

Additional context

Code of Conduct

CodeDoctorDE commented 7 months ago

Hi, can you show me a butterfly file that creates a big svg? It shouldn't be bigger than the butterfly file

HusniMuhammad commented 7 months ago

It's not create bigger than butterfly file, but still the svg lots of buggy

Screenshot_20240305-151549

Screenshot_20240303-084749

CodeDoctorDE commented 7 months ago

But is this file really big? I think i improve the path, I can combine all points into one long path

HusniMuhammad commented 7 months ago

Relatively big file size

Also try to reduce decimal points

Btw I'm using this script to faster the issue reporting

IMG_20240305_152453

Shortcut to Launcher export

Is it ok?

HusniMuhammad commented 7 months ago

Url based shortcuts not supported by chrome app for GitHub due to this

But I'm created a script to alter that

CodeDoctorDE commented 7 months ago

I improved the svg export a bit, if you want you can try out: https://butterfly-git-feature-improve-svg-linwood.vercel.app/ (it takes 5 minutes to build)

HusniMuhammad commented 7 months ago

Screenshot_20240305-154813 Screenshot_20240305-154935 I'm getting random numbers as output file size around 190kb

CodeDoctorDE commented 7 months ago

Okay that's the bytes that should be written to the file as binary and not as text xd Which platform are you on with which os/browser?

HusniMuhammad commented 7 months ago

Okay that's the bytes that should be written to the file as binary and not as text xd Which platform are you on with which os/browser?

Screenshot_20240305-155526

HusniMuhammad commented 7 months ago

Ok that's why character count and byte count are same 😅 Screenshot_20240305-155905

CodeDoctorDE commented 7 months ago

Hmm, i don't know. I get the same problem on web, but not on native platforms. I will notify you if I have something new

HusniMuhammad commented 7 months ago

Hmm, i don't know. I get the same problem on web, but not on native platforms. I will notify you if I have something new

Ok

CodeDoctorDE commented 7 months ago

okay fixed, can you try out?

HusniMuhammad commented 7 months ago

okay fixed, can you try out?

Ok with the same Link

HusniMuhammad commented 7 months ago

Still big though Screenshot_20240305-164928

Reduce decimals

HusniMuhammad commented 7 months ago

okay fixed, can you try out?

Ok with the same Link

22kb for simple curve

CodeDoctorDE commented 7 months ago

Hmm, okay I will try it further

HusniMuhammad commented 7 months ago

Hmm, okay I will try it further

Tips

CodeDoctorDE commented 7 months ago

Okay now it should be better. I think I can't smaller the size more

HusniMuhammad commented 7 months ago

ok thanks for the improvement

CodeDoctorDE commented 7 months ago

Fixed in 2.1.0-beta.2