Skip to content

Instantly share code, notes, and snippets.

@dennisdebel
dennisdebel / gist:d67263c737f338e72eaf0705bcbf25ff
Created September 3, 2026 09:24
RAWFIX: Fix corrupt Canon Raw Files
# RAWFIX: Fix corrupted Canon RAW files using a working donor image and exiftools
#
# Prerequisits: python3, exiftool
#
# Usage: just copy paste in python3 interactive mode and press enter twice,
# after running the script, exit python and fix the repaired file (offset) using:
# $ exiftool -tagsFromFile /Users/a/Downloads/recover-raw/3B1A5335.CR2 -all:all /Users/a/Downloads/recover-raw/3B1A5336-repaired.CR2
# optionally you can rebuild meta data so the file is more compatible: exiftool -overwrite_original -tagsFromFile /Users/a/Downloads/recover-raw/3B1A5335.CR2 -all:all /Users/apple/Downloads/recover-raw/3B1A5336-repaired.CR2
import os
@dennisdebel
dennisdebel / bm280.cpp
Created February 5, 2023 18:20
Snippet to reset bme280 sensor on erroneous readings
void BME280_Reset()
{
if(DEBUG) Serial.println(F("BME280 Reset"));
Wire.beginTransmission(BME280_I2C_ADDR);
Wire.write((uint8_t)BME280_REGISTER_SOFTRESET);
Wire.write((uint8_t)0xB6);
Wire.endTransmission();
delay(1000);
}