Skip to content

Instantly share code, notes, and snippets.

View bitsgalore's full-sized avatar

Johan van der Knijff bitsgalore

View GitHub Profile
@bitsgalore
bitsgalore / MalformedFilter-Xerox.xml
Created December 17, 2024 16:21
Arlington model checker output for MalformedFilter-Xerox.pdf
<?xml version="1.0" encoding="utf-8"?>
<report>
<buildInformation>
<releaseDetails id="validation-model-arlington" version="1.23.66" buildDate="2023-06-21T07:25:00+02:00"></releaseDetails>
<releaseDetails id="gui-arlington" version="1.23.68" buildDate="2023-06-21T07:31:00+02:00"></releaseDetails>
<releaseDetails id="core-arlington" version="1.23.35" buildDate="2023-06-19T20:45:00+02:00"></releaseDetails>
</buildInformation>
<jobs>
<job>
<item size="13565">
#! /usr/bin/env python3
"""
Implement JPEG quality computation following (an adapted version of)
ImageMagick's heuristic algorithm.
Adapted from Edward O's Python port:
https://gist.github.com/eddy-geek/c0f01dc5401dc50a49a0a821cdc9b3e8#file-jpg_quality_pil_magick-py
#! /usr/bin/env python3
"""
Implement JPEG quality computation following (an adapted version of)
ImageMagick's heuristic algorithm.
Adapted from Edward O's Python port:
https://gist.github.com/eddy-geek/c0f01dc5401dc50a49a0a821cdc9b3e8#file-jpg_quality_pil_magick-py
@bitsgalore
bitsgalore / jpylyzer-create-testfiles-profiles.sh
Created October 3, 2023 14:23
Create Jpylyzer testfiles with different profiles
#!/bin/bash
# Location of Kakadu binaries
kduPath=/Applications/kakadu
# Add Kakadu path to LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$kduPath
# Create TIFF from existing JP2
/Applications/kakadu/kdu_expand -i aware.jp2 -o aware.tif
@bitsgalore
bitsgalore / tweet-example.json
Created November 20, 2022 13:32
Example of JSON format used in Twitter archive for one single Tweet (from tweets.js)
{
"tweet" : {
"edit_info" : {
"initial" : {
"editTweetIds" : [
"1588159317974319106"
],
"editableUntil" : "2022-11-03T13:51:02.000Z",
"editsRemaining" : "5",
"isEditEligible" : false
@bitsgalore
bitsgalore / ht2jk-jpylyzer.xnl
Created August 3, 2022 18:52
Jpylyzer output for High Throughput JPEG 2000 codestream downloaded from https://chafey.github.io/openjphjs/test/browser/index.html
<?xml version='1.0' encoding='UTF-8'?>
<jpylyzer xmlns="http://openpreservation.org/ns/jpylyzer/v2/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://openpreservation.org/ns/jpylyzer/v2/ http://jpylyzer.openpreservation.org/jpylyzer-v-2-0.xsd">
<toolInfo>
<toolName>jpylyzer</toolName>
<toolVersion>2.0.0</toolVersion>
</toolInfo>
<file>
<fileInfo>
<fileName>6e3Gf8Mu</fileName>
<filePath>/home/johan/test/6e3Gf8Mu</filePath>
@bitsgalore
bitsgalore / readme.md
Last active June 14, 2022 15:20
Storage media type detection using the Windows API and Python
@bitsgalore
bitsgalore / iso9660-withschema.xml
Created April 19, 2022 16:54
Isolyzer output with added namespace and XSD schema definitions
<?xml version="1.0" ?>
<isolyzer xmlns="http://kb.nl/ns/isolyzer/v1/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://kb.nl/ns/isolyzer/v1/ https://raw.githubusercontent.com/KBNLresearch/isolyzer/xsd/xsd/isolyzer-v-1-0.xsd">
<toolInfo>
<toolName>cli.py</toolName>
<toolVersion>1.4.0a2</toolVersion>
</toolInfo>
<image>
<fileInfo>
<fileName>iso9660.iso</fileName>
<filePath>/home/johan/isolyzer/testFiles/iso9660.iso</filePath>
@bitsgalore
bitsgalore / highsierra.xml
Created April 14, 2022 15:09
Isolyzer output for High Sierra file system
<?xml version="1.0" ?>
<isolyzer>
<toolInfo>
<toolName>cli.py</toolName>
<toolVersion>1.4.0a1</toolVersion>
</toolInfo>
<image>
<fileInfo>
<fileName>BOOKSHELF.iso01.iso</fileName>
<filePath>/home/johan/kb/iso-identification/HSF/BOOKSHELF.iso01.iso</filePath>
@bitsgalore
bitsgalore / test-cli-wildcard.py
Created April 12, 2022 16:49
Cross-platform CLI file input with wildcards
import sys
import os
import glob
import platform
import codecs
import argparse
# Create parser
parser = argparse.ArgumentParser(
description="Test CLI input with wildcards, multiple platforms")