Skip to content

Instantly share code, notes, and snippets.

View karnadii's full-sized avatar

Ujang Karnadi karnadii

View GitHub Profile
@karnadii
karnadii / fetch_image_size.dart
Last active February 24, 2024 11:50
prefetch image size
// ignore_for_file: avoid_print
// Import necessary Dart libraries
import 'dart:async';
import 'dart:io';
import 'dart:typed_data';
import 'package:http/http.dart' as http;
// List of image URLs to be processed
@karnadii
karnadii / crop_border_image.dart
Last active February 24, 2024 03:24
Crop a white border of an image
// ignore_for_file: avoid_print
// Import necessary libraries
import 'dart:io';
import 'package:image/image.dart' as img;
// Main function
void main(List<String> args) async {
// Check if the path to the image file and the color of the border to remove are provided
if (args.length < 2) {