react-native-svg icon indicating copy to clipboard operation
react-native-svg copied to clipboard

feat: add format and quality parameters toDataURL function

Open bohdanprog opened this issue 1 year ago • 0 comments

Summary

Feature #1588 Introduce new parameters, format, and quality, for the toDataURL function.

Allow users to select the compressed format (defaulting to PNG or JPEG) in the toDataURL function. Additionally, include a new parameter called quality for the JPEG format. Created a new type, ToDataUrlOptions, and exported it externally.

The data structure appears as follows:

  const optionsWithJPEGFormat: ToDataUrlOptions = {
    format: 'jpeg',
    width,
    height,
    quality: 100,
  };
  const optionsWithPNGFormat: ToDataUrlOptions = {
    format: 'png',
    width,
    height,
  };

Test Plan

What's required for testing (prerequisites)?

What are the steps to reproduce (after prerequisites)?

Compatibility

OS Implemented
iOS
MacOS
Android
Web

Checklist

  • [x] I have tested this on a device and a simulator
  • [ ] I added documentation in README.md
  • [x] I updated the typed files (typescript)

bohdanprog avatar Aug 28 '24 11:08 bohdanprog