mirror of
https://github.com/sharevb/it-tools.git
synced 2026-11-24 14:50:17 +03:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
57519777ee | ||
|
|
d7c207cc52 |
No files matched your search
Vendored
-1
@@ -112,7 +112,6 @@ declare module '@vue/runtime-core' {
|
||||
IconMdiVideo: typeof import('~icons/mdi/video')['default']
|
||||
InputCopyable: typeof import('./src/components/InputCopyable.vue')['default']
|
||||
IntegerBaseConverter: typeof import('./src/tools/integer-base-converter/integer-base-converter.vue')['default']
|
||||
IpRangeToCidr: typeof import('./src/tools/ip-range-to-cidr/ip-range-to-cidr.vue')['default']
|
||||
Ipv4AddressConverter: typeof import('./src/tools/ipv4-address-converter/ipv4-address-converter.vue')['default']
|
||||
Ipv4RangeExpander: typeof import('./src/tools/ipv4-range-expander/ipv4-range-expander.vue')['default']
|
||||
Ipv4SubnetCalculator: typeof import('./src/tools/ipv4-subnet-calculator/ipv4-subnet-calculator.vue')['default']
|
||||
|
||||
+2
-6
@@ -48,7 +48,6 @@
|
||||
"@vueuse/router": "^10.0.0",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"change-case": "^4.1.2",
|
||||
"cidr-tools": "^7.0.4",
|
||||
"colord": "^2.9.3",
|
||||
"composerize-ts": "^0.6.2",
|
||||
"country-code-lookup": "^0.1.0",
|
||||
@@ -58,16 +57,13 @@
|
||||
"date-fns": "^2.29.3",
|
||||
"dompurify": "^3.0.6",
|
||||
"emojilib": "^3.0.10",
|
||||
"exifreader": "^4.20.0",
|
||||
"figue": "^1.2.0",
|
||||
"fuse.js": "^6.6.2",
|
||||
"highlight.js": "^11.7.0",
|
||||
"iarna-toml-esm": "^3.0.5",
|
||||
"ibantools": "^4.3.3",
|
||||
"ip-address": "^9.0.5",
|
||||
"ip-bigint": "^8.0.2",
|
||||
"ip-cidr": "^4.0.0",
|
||||
"is-cidr": "^5.0.3",
|
||||
"is-ip": "^5.0.1",
|
||||
"jpeg-quality-estimator": "^1.0.1",
|
||||
"json5": "^2.2.3",
|
||||
"jwt-decode": "^3.1.2",
|
||||
"libphonenumber-js": "^1.10.28",
|
||||
|
||||
Generated
+24
-114
@@ -44,9 +44,6 @@ dependencies:
|
||||
change-case:
|
||||
specifier: ^4.1.2
|
||||
version: 4.1.2
|
||||
cidr-tools:
|
||||
specifier: ^7.0.4
|
||||
version: 7.0.4
|
||||
colord:
|
||||
specifier: ^2.9.3
|
||||
version: 2.9.3
|
||||
@@ -74,6 +71,9 @@ dependencies:
|
||||
emojilib:
|
||||
specifier: ^3.0.10
|
||||
version: 3.0.10
|
||||
exifreader:
|
||||
specifier: ^4.20.0
|
||||
version: 4.20.0
|
||||
figue:
|
||||
specifier: ^1.2.0
|
||||
version: 1.2.0
|
||||
@@ -89,21 +89,9 @@ dependencies:
|
||||
ibantools:
|
||||
specifier: ^4.3.3
|
||||
version: 4.3.3
|
||||
ip-address:
|
||||
specifier: ^9.0.5
|
||||
version: 9.0.5
|
||||
ip-bigint:
|
||||
specifier: ^8.0.2
|
||||
version: 8.0.2
|
||||
ip-cidr:
|
||||
specifier: ^4.0.0
|
||||
version: 4.0.0
|
||||
is-cidr:
|
||||
specifier: ^5.0.3
|
||||
version: 5.0.3
|
||||
is-ip:
|
||||
specifier: ^5.0.1
|
||||
version: 5.0.1
|
||||
jpeg-quality-estimator:
|
||||
specifier: ^1.0.1
|
||||
version: 1.0.1
|
||||
json5:
|
||||
specifier: ^2.2.3
|
||||
version: 2.2.3
|
||||
@@ -4043,6 +4031,13 @@ packages:
|
||||
- vue
|
||||
dev: false
|
||||
|
||||
/@xmldom/xmldom@0.8.10:
|
||||
resolution: {integrity: sha512-2WALfTl4xo2SkGCYRt6rDTFfk9R1czmBvUQy12gK2KuRKIpWEhcbbzy8EZXtz/jkRqHX8bFEc6FC1HjX4TUWYw==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
requiresBuild: true
|
||||
dev: false
|
||||
optional: true
|
||||
|
||||
/@zhead/schema@1.0.0-beta.13:
|
||||
resolution: {integrity: sha512-P1A1vRGFBhITco8Iw4/hvnDYoE/SoVrd71dW1pBFdXJb3vP+pBtoOuhbEKy0ROJGOyzQuqvFibcwzyLlWMqNiQ==}
|
||||
dev: false
|
||||
@@ -4504,20 +4499,6 @@ packages:
|
||||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/cidr-regex@4.0.3:
|
||||
resolution: {integrity: sha512-HOwDIy/rhKeMf6uOzxtv7FAbrz8zPjmVKfSpM+U7/bNBXC5rtOyr758jxcptiSx6ZZn5LOhPJT5WWxPAGDV8dw==}
|
||||
engines: {node: '>=14'}
|
||||
dependencies:
|
||||
ip-regex: 5.0.0
|
||||
dev: false
|
||||
|
||||
/cidr-tools@7.0.4:
|
||||
resolution: {integrity: sha512-bKd6xC01ObuVKvJPGdV9Rz02KFO3mtHwMe/QTlcVuFAmU5n3RN/F3FgppHZaQjM+c/1i9YB9rgKNH/5iVqwCoA==}
|
||||
engines: {node: '>=18'}
|
||||
dependencies:
|
||||
ip-bigint: 8.0.2
|
||||
dev: false
|
||||
|
||||
/clean-regexp@1.0.0:
|
||||
resolution: {integrity: sha512-GfisEZEJvzKrmGWkvfhgzcz/BllN1USeqD2V6tg14OAOgaCD2Z/PUEuxnAZ/nPvmaHRG7a8y77p1T/IRQ4D1Hw==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -4545,13 +4526,6 @@ packages:
|
||||
wrap-ansi: 6.2.0
|
||||
dev: false
|
||||
|
||||
/clone-regexp@3.0.0:
|
||||
resolution: {integrity: sha512-ujdnoq2Kxb8s3ItNBtnYeXdm07FcU0u8ARAT1lQ2YdMwQC+cdiXX8KoqMVuglztILivceTtp4ivqGSmEmhBUJw==}
|
||||
engines: {node: '>=12'}
|
||||
dependencies:
|
||||
is-regexp: 3.1.0
|
||||
dev: false
|
||||
|
||||
/clone@1.0.4:
|
||||
resolution: {integrity: sha512-JQHZ2QMW6l3aH/j6xCqQThY/9OH4D/9ls34cgkUBiEeocRTU04tHfKPBsUK1PqZCUQM7GiA0IIXJSuXHI64Kbg==}
|
||||
engines: {node: '>=0.8'}
|
||||
@@ -4656,11 +4630,6 @@ packages:
|
||||
upper-case: 2.0.2
|
||||
dev: false
|
||||
|
||||
/convert-hrtime@5.0.0:
|
||||
resolution: {integrity: sha512-lOETlkIeYSJWcbbcvjRKGxVMXJR+8+OQb/mTPbA4ObPMytYIsUbuOE0Jzy60hjARYszq1id0j8KgVhC+WGZVTg==}
|
||||
engines: {node: '>=12'}
|
||||
dev: false
|
||||
|
||||
/convert-source-map@1.9.0:
|
||||
resolution: {integrity: sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==}
|
||||
dev: true
|
||||
@@ -5611,6 +5580,13 @@ packages:
|
||||
strip-final-newline: 2.0.0
|
||||
dev: true
|
||||
|
||||
/exifreader@4.20.0:
|
||||
resolution: {integrity: sha512-C28BhOHe5svd0Jj/5DGSIXD3PnPp46gfvHN4OkRfvHYZHkcJMhxeUxlwsgJ6Yl62zlZRtmfN+9suZFg0fv4hgg==}
|
||||
requiresBuild: true
|
||||
optionalDependencies:
|
||||
'@xmldom/xmldom': 0.8.10
|
||||
dev: false
|
||||
|
||||
/extend-shallow@2.0.1:
|
||||
resolution: {integrity: sha512-zCnTtlxNoAiDc3gqY2aYAWFx7XWWiasuF2K8Me5WbN8otHKTUKBwjPtNpRs/rbUZm7KxWAaNj7P1a/p52GbVug==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
@@ -5805,11 +5781,6 @@ packages:
|
||||
resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}
|
||||
dev: true
|
||||
|
||||
/function-timeout@0.1.1:
|
||||
resolution: {integrity: sha512-0NVVC0TaP7dSTvn1yMiy6d6Q8gifzbvQafO46RtLG/kHJUBNd+pVRGOBoK44wNBvtSPUJRfdVvkFdD3p0xvyZg==}
|
||||
engines: {node: '>=14.16'}
|
||||
dev: false
|
||||
|
||||
/function.prototype.name@1.1.6:
|
||||
resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==}
|
||||
engines: {node: '>= 0.4'}
|
||||
@@ -6244,19 +6215,6 @@ packages:
|
||||
sprintf-js: 1.1.2
|
||||
dev: false
|
||||
|
||||
/ip-address@9.0.5:
|
||||
resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==}
|
||||
engines: {node: '>= 12'}
|
||||
dependencies:
|
||||
jsbn: 1.1.0
|
||||
sprintf-js: 1.1.3
|
||||
dev: false
|
||||
|
||||
/ip-bigint@8.0.2:
|
||||
resolution: {integrity: sha512-UMKHGx7+4O2mD/6jnpNtt4UMA0tRQ3XAiNVYlbLssFU1LegKqKwPqbqtLVW7lQU/c6rCWI1hcxxs4TP96Xa+rQ==}
|
||||
engines: {node: '>=18'}
|
||||
dev: false
|
||||
|
||||
/ip-cidr@3.1.0:
|
||||
resolution: {integrity: sha512-HUCn4snshEX1P8cja/IyU3qk8FVDW8T5zZcegDFbu4w7NojmAhk5NcOgj3M8+0fmumo1afJTPDtJlzsxLdOjtg==}
|
||||
engines: {node: '>=10.0.0'}
|
||||
@@ -6265,18 +6223,6 @@ packages:
|
||||
jsbn: 1.1.0
|
||||
dev: false
|
||||
|
||||
/ip-cidr@4.0.0:
|
||||
resolution: {integrity: sha512-i1Jhb9sqm2+PuOHTfya3ekAUi+dadhgcEz+4FKKY1hXemocP4Xf7io8Xflc74/i2ejxe/5fp4z8z3BAsfAZ8sw==}
|
||||
engines: {node: '>=16.14.0'}
|
||||
dependencies:
|
||||
ip-address: 9.0.5
|
||||
dev: false
|
||||
|
||||
/ip-regex@5.0.0:
|
||||
resolution: {integrity: sha512-fOCG6lhoKKakwv+C6KdsOnGvgXnmgfmp0myi3bcNwj3qfwPAxRKWEuFhvEFF7ceYIz6+1jRZ+yguLFAmUNPEfw==}
|
||||
engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0}
|
||||
dev: false
|
||||
|
||||
/is-alphabetical@1.0.4:
|
||||
resolution: {integrity: sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg==}
|
||||
dev: true
|
||||
@@ -6332,13 +6278,6 @@ packages:
|
||||
engines: {node: '>= 0.4'}
|
||||
dev: true
|
||||
|
||||
/is-cidr@5.0.3:
|
||||
resolution: {integrity: sha512-lKkM0tmz07dAxNsr8Ii9MGreExa9ZR34N9j8mTG5op824kcwBqinZPowNjcVWWc7j+jR8XAMMItOmBkniN0jOA==}
|
||||
engines: {node: '>=14'}
|
||||
dependencies:
|
||||
cidr-regex: 4.0.3
|
||||
dev: false
|
||||
|
||||
/is-core-module@2.13.0:
|
||||
resolution: {integrity: sha512-Z7dk6Qo8pOCp3l4tsX2C5ZVas4V+UxwQodwZhLopL91TX8UyyHEXafPcyoeeWuLrwzHcr3igO78wNLwHJHsMCQ==}
|
||||
dependencies:
|
||||
@@ -6404,14 +6343,6 @@ packages:
|
||||
engines: {node: '>=8'}
|
||||
dev: true
|
||||
|
||||
/is-ip@5.0.1:
|
||||
resolution: {integrity: sha512-FCsGHdlrOnZQcp0+XT5a+pYowf33itBalCl+7ovNXC/7o5BhIpG14M3OrpPPdBSIQJCm+0M5+9mO7S9VVTTCFw==}
|
||||
engines: {node: '>=14.16'}
|
||||
dependencies:
|
||||
ip-regex: 5.0.0
|
||||
super-regex: 0.2.0
|
||||
dev: false
|
||||
|
||||
/is-lower-case@1.1.3:
|
||||
resolution: {integrity: sha512-+5A1e/WJpLLXZEDlgz4G//WYSHyQBD32qa4Jd3Lw06qQlv3fJHnp3YIHjTQSGzHMgzmVKz2ZP3rBxTHkPw/lxA==}
|
||||
dependencies:
|
||||
@@ -6477,11 +6408,6 @@ packages:
|
||||
engines: {node: '>=0.10.0'}
|
||||
dev: true
|
||||
|
||||
/is-regexp@3.1.0:
|
||||
resolution: {integrity: sha512-rbku49cWloU5bSMI+zaRaXdQHXnthP6DZ/vLnfdSKyL4zUzuWnomtOEiZZOd+ioQ+avFo/qau3KPTc7Fjy1uPA==}
|
||||
engines: {node: '>=12'}
|
||||
dev: false
|
||||
|
||||
/is-shared-array-buffer@1.0.2:
|
||||
resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==}
|
||||
dependencies:
|
||||
@@ -6584,6 +6510,10 @@ packages:
|
||||
hasBin: true
|
||||
dev: true
|
||||
|
||||
/jpeg-quality-estimator@1.0.1:
|
||||
resolution: {integrity: sha512-Znaq+msIqs8Gmhg9JSdDjxUAZMOwYXWIURrfluimn5u2yJ4QAEDhf0tnTMkv3ikcHJoJysG5ewxfbqUXyw/Djg==}
|
||||
dev: false
|
||||
|
||||
/js-beautify@1.14.6:
|
||||
resolution: {integrity: sha512-GfofQY5zDp+cuHc+gsEXKPpNw2KbPddreEo35O6jT6i0RVK6LhsoYBhq5TvK4/n74wnA0QbK8gGd+jUZwTMKJw==}
|
||||
engines: {node: '>=10'}
|
||||
@@ -8319,10 +8249,6 @@ packages:
|
||||
resolution: {integrity: sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==}
|
||||
dev: false
|
||||
|
||||
/sprintf-js@1.1.3:
|
||||
resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==}
|
||||
dev: false
|
||||
|
||||
/sql-formatter@13.0.0:
|
||||
resolution: {integrity: sha512-V21cVvge4rhn9Fa7K/fTKcmPM+x1yee6Vhq8ZwgaWh3VPBqApgsaoFB5kLAhiqRo5AmSaRyLU7LIdgnNwH01/w==}
|
||||
hasBin: true
|
||||
@@ -8453,15 +8379,6 @@ packages:
|
||||
dependencies:
|
||||
acorn: 8.11.2
|
||||
|
||||
/super-regex@0.2.0:
|
||||
resolution: {integrity: sha512-WZzIx3rC1CvbMDloLsVw0lkZVKJWbrkJ0k1ghKFmcnPrW1+jWbgTkTEWVtD9lMdmI4jZEz40+naBxl1dCUhXXw==}
|
||||
engines: {node: '>=14.16'}
|
||||
dependencies:
|
||||
clone-regexp: 3.0.0
|
||||
function-timeout: 0.1.1
|
||||
time-span: 5.1.0
|
||||
dev: false
|
||||
|
||||
/supports-color@5.5.0:
|
||||
resolution: {integrity: sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==}
|
||||
engines: {node: '>=4'}
|
||||
@@ -8554,13 +8471,6 @@ packages:
|
||||
resolution: {integrity: sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==}
|
||||
dev: true
|
||||
|
||||
/time-span@5.1.0:
|
||||
resolution: {integrity: sha512-75voc/9G4rDIJleOo4jPvN4/YC4GRZrY8yy1uU4lwrB3XEQbWve8zXoO5No4eFrGcTAMYyoY67p8jRQdtA1HbA==}
|
||||
engines: {node: '>=12'}
|
||||
dependencies:
|
||||
convert-hrtime: 5.0.0
|
||||
dev: false
|
||||
|
||||
/tiny-emitter@2.1.0:
|
||||
resolution: {integrity: sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==}
|
||||
dev: false
|
||||
|
||||
@@ -0,0 +1,155 @@
|
||||
<script setup lang="ts">
|
||||
import ExifReader from 'exifreader';
|
||||
import getJpegQuality from 'jpeg-quality-estimator';
|
||||
import { formatBytes } from '@/utils/convert';
|
||||
|
||||
interface Tag {
|
||||
id: number
|
||||
name: string
|
||||
value: any
|
||||
description: string
|
||||
}
|
||||
|
||||
interface TagsSection {
|
||||
[name: string]: Tag
|
||||
}
|
||||
|
||||
const tagsSections = ref<{ name: string; title: string }[]>([
|
||||
{ name: 'file', title: 'File Tags' },
|
||||
{ name: 'jfif', title: 'JFIF Tags' },
|
||||
{ name: 'pngFile', title: 'PNG File Tags' },
|
||||
{ name: 'pngText', title: 'PNG Text Tags' },
|
||||
{ name: 'png', title: 'PNG Tags' },
|
||||
{ name: 'exif', title: 'EXIF Tags' },
|
||||
{ name: 'iptc', title: 'IPTC Tags' },
|
||||
{ name: 'xmp', title: 'XMP Tags' },
|
||||
{ name: 'icc', title: 'ICC Tags' },
|
||||
{ name: 'riff', title: 'RIFF Tags' },
|
||||
{ name: 'gif', title: 'GIF Tags' },
|
||||
{ name: 'Thumbnail', title: 'Thumbnail Tags' },
|
||||
{ name: 'photoshop', title: 'Photoshop Tags' },
|
||||
]);
|
||||
|
||||
const errorMessage = ref<string>('');
|
||||
const tags = ref<ExifReader.ExpandedTags>({});
|
||||
const status = ref<'idle' | 'parsed' | 'error' | 'loading'>('idle');
|
||||
const file = ref<File | null>(null);
|
||||
const quality = ref<number>(-1);
|
||||
|
||||
const openStreetMapUrl = computed(
|
||||
() => {
|
||||
const gpsLatitude = tags.value.gps?.Latitude;
|
||||
const gpsLongitude = tags.value.gps?.Longitude;
|
||||
return gpsLatitude && gpsLongitude ? `https://www.openstreetmap.org/?mlat=${gpsLatitude}&mlon=${gpsLongitude}#map=18/${gpsLatitude}/${gpsLongitude}` : undefined;
|
||||
},
|
||||
);
|
||||
|
||||
async function onImageUploaded(uploadedFile: File) {
|
||||
file.value = uploadedFile;
|
||||
|
||||
const fileBuffer = await uploadedFile.arrayBuffer();
|
||||
status.value = 'loading';
|
||||
try {
|
||||
quality.value = getJpegQuality(new Uint8Array(fileBuffer));
|
||||
}
|
||||
catch (e) {
|
||||
quality.value = -1;
|
||||
}
|
||||
try {
|
||||
tags.value = await ExifReader.load(fileBuffer, { expanded: true });
|
||||
status.value = 'parsed';
|
||||
}
|
||||
catch (e: any) {
|
||||
errorMessage.value = e.toString();
|
||||
status.value = 'error';
|
||||
}
|
||||
}
|
||||
function getSection(sectionName: string): TagsSection | null {
|
||||
const sections = tags.value as { [name: string]: TagsSection };
|
||||
return sections[sectionName] ? sections[sectionName] : null;
|
||||
}
|
||||
const addSpacesToTagNames = (label: string) => label.replace(/([A-Z][a-z])/g, ' $1').trim();
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div style="flex: 0 0 100%">
|
||||
<div mx-auto max-w-600px>
|
||||
<c-file-upload title="Drag and drop a Image file here, or click to select a file" @file-upload="onImageUploaded" />
|
||||
|
||||
<c-card v-if="file" mt-4 flex gap-2>
|
||||
<div font-bold>
|
||||
{{ file.name }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{{ formatBytes(file.size) }}
|
||||
</div>
|
||||
|
||||
<div v-if="tags.Thumbnail">
|
||||
<img :src="`data:image/jpeg;base64,${tags.Thumbnail.base64}`" max-w-200px>
|
||||
</div>
|
||||
</c-card>
|
||||
|
||||
<div v-if="status === 'error'">
|
||||
<c-alert mt-4>
|
||||
Error parsing image file: {{ errorMessage }}
|
||||
</c-alert>
|
||||
</div>
|
||||
|
||||
<c-card v-if="quality >= 0" title="JPEG Quality" mt-4>
|
||||
<input-copyable
|
||||
label="JPEG Quality (%)"
|
||||
label-position="left"
|
||||
label-width="150px"
|
||||
label-align="right"
|
||||
mb-2
|
||||
:value="quality"
|
||||
/>
|
||||
</c-card>
|
||||
|
||||
<c-card v-if="status === 'parsed' && openStreetMapUrl" title="GPS Infos" mt-4>
|
||||
<div flex gap-2>
|
||||
<c-label label="Latitude">
|
||||
{{ tags.gps?.Latitude?.toFixed(4) }}
|
||||
</c-label>
|
||||
<c-label label="Longitude">
|
||||
{{ tags.gps?.Longitude?.toFixed(4) }}
|
||||
</c-label>
|
||||
<c-label label="Altitude">
|
||||
{{ tags.gps?.Altitude?.toFixed(4) }}
|
||||
</c-label>
|
||||
</div>
|
||||
<c-button :href="openStreetMapUrl" target="_blank" mt-4>
|
||||
Localize on Open Street Map
|
||||
</c-button>
|
||||
</c-card>
|
||||
<c-card v-if="status === 'parsed' && !openStreetMapUrl" mt-4>
|
||||
No GPS Information
|
||||
</c-card>
|
||||
|
||||
<div v-if="status === 'parsed'">
|
||||
<div v-for="section in tagsSections" :key="section.name">
|
||||
<c-card v-if="getSection(section.name)" :title="section.title" mt-4>
|
||||
<input-copyable
|
||||
v-for="({ description }, tagName) in getSection(section.name)"
|
||||
:key="tagName"
|
||||
:label="addSpacesToTagNames(String(tagName))"
|
||||
label-position="left"
|
||||
label-width="150px"
|
||||
label-align="right"
|
||||
mb-2
|
||||
disabled="disabled"
|
||||
:value="description ?? '<binary>'"
|
||||
/>
|
||||
</c-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div v-if="status === 'parsed'" style="flex: 0 0 100%" mt-5 flex flex-col gap-4 />
|
||||
|
||||
<div font-size-3>
|
||||
Made with <a href="https://github.com/mattiasw/ExifReader" target="_blank">ExifReader</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { FileInfo } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'Image EXIF/Metadata/GPS/JPEG Quality reader',
|
||||
path: '/image-exif-reader',
|
||||
description: 'Read EXIF, IPTC, XMP, GPS and other metadata, JPEG Quality, and other infos from images files',
|
||||
keywords: ['image', 'exif', 'reader', 'iptc', 'gps', 'xmp', 'jpeg', 'quality'],
|
||||
component: () => import('./image-exif-reader.vue'),
|
||||
icon: FileInfo,
|
||||
createdAt: new Date('2024-01-09'),
|
||||
});
|
||||
@@ -0,0 +1,4 @@
|
||||
declare module 'jpeg-quality-estimator' {
|
||||
const getJpegQuality: (file: Uint8Array) => number;
|
||||
export default getJpegQuality;
|
||||
}
|
||||
+9
-11
@@ -76,8 +76,8 @@ import { tool as urlParser } from './url-parser';
|
||||
import { tool as uuidGenerator } from './uuid-generator';
|
||||
import { tool as macAddressLookup } from './mac-address-lookup';
|
||||
import { tool as xmlFormatter } from './xml-formatter';
|
||||
import { tool as imageExifReader } from './image-exif-reader';
|
||||
import { tool as yamlViewer } from './yaml-viewer';
|
||||
import { tool as ipRangeToCidr } from './ip-range-to-cidr';
|
||||
|
||||
export const toolsByCategory: ToolCategory[] = [
|
||||
{
|
||||
@@ -128,7 +128,13 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
},
|
||||
{
|
||||
name: 'Images and videos',
|
||||
components: [qrCodeGenerator, wifiQrCodeGenerator, svgPlaceholderGenerator, cameraRecorder],
|
||||
components: [
|
||||
qrCodeGenerator,
|
||||
wifiQrCodeGenerator,
|
||||
svgPlaceholderGenerator,
|
||||
cameraRecorder,
|
||||
imageExifReader,
|
||||
],
|
||||
},
|
||||
{
|
||||
name: 'Development',
|
||||
@@ -148,15 +154,7 @@ export const toolsByCategory: ToolCategory[] = [
|
||||
},
|
||||
{
|
||||
name: 'Network',
|
||||
components: [
|
||||
ipv4SubnetCalculator,
|
||||
ipv4AddressConverter,
|
||||
ipv4RangeExpander,
|
||||
ipRangeToCidr,
|
||||
macAddressLookup,
|
||||
macAddressGenerator,
|
||||
ipv6UlaGenerator,
|
||||
],
|
||||
components: [ipv4SubnetCalculator, ipv4AddressConverter, ipv4RangeExpander, macAddressLookup, macAddressGenerator, ipv6UlaGenerator],
|
||||
},
|
||||
{
|
||||
name: 'Math',
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
import { Binary } from '@vicons/tabler';
|
||||
import { defineTool } from '../tool';
|
||||
|
||||
export const tool = defineTool({
|
||||
name: 'IPv4/6 Range to CIDR(s) Calculator',
|
||||
path: '/ip-range-to-cidr',
|
||||
description: 'Calculate CIDR(s) from an IP Range (IPv4/6)',
|
||||
keywords: ['ip', 'range', 'to', 'cidr'],
|
||||
component: () => import('./ip-range-to-cidr.vue'),
|
||||
icon: Binary,
|
||||
createdAt: new Date('2024-01-10'),
|
||||
});
|
||||
-17
@@ -1,17 +0,0 @@
|
||||
declare module 'ip-bigint' {
|
||||
type IPInfo = {
|
||||
number: bigint;
|
||||
version: number;
|
||||
ipv4mapped?: boolean;
|
||||
scopeid?:string;
|
||||
};
|
||||
type StringifyOptions = {
|
||||
compress?:boolean;
|
||||
hexify?:boolean;
|
||||
};
|
||||
|
||||
export function normalizeIp(ip: string, options: StringifyOptions = {compress = true, hexify = false} = {})
|
||||
export function stringifyIp(ip: IPInfo, options: StringifyOptions = {compress = true, hexify = false}): string;
|
||||
export function ipVersion(ip: string): number;
|
||||
export function parseIp(ip): IPInfo;
|
||||
}
|
||||
@@ -1,117 +0,0 @@
|
||||
<script setup lang="ts">
|
||||
import { merge, parse } from 'cidr-tools';
|
||||
import { isIP, isIPv6 } from 'is-ip';
|
||||
import { Exchange } from '@vicons/tabler';
|
||||
import { stringifyIp } from 'ip-bigint';
|
||||
import { useValidation } from '@/composable/validation';
|
||||
|
||||
const rawStartAddress = useStorage('ip-range-to-cidr:startAddress', '192.168.1.1');
|
||||
const rawEndAddress = useStorage('ip-range-to-cidr:endAddress', '192.168.6.255');
|
||||
|
||||
const isReversed = ref<boolean>(false);
|
||||
const isNotSameVersion = ref<boolean>(false);
|
||||
|
||||
const result = computed(() => {
|
||||
try {
|
||||
isNotSameVersion.value = isIPv6(rawEndAddress.value) !== isIPv6(rawStartAddress.value);
|
||||
isReversed.value = false;
|
||||
if (isNotSameVersion.value) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const startIp = parse(rawStartAddress.value).start;
|
||||
const endIp = parse(rawEndAddress.value).end;
|
||||
isReversed.value = startIp > endIp;
|
||||
if (isReversed.value) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const version = isIPv6(rawStartAddress.value) ? 6 : 4;
|
||||
const ipRangeLength = endIp - startIp + 1n;
|
||||
const allIps = new BigInt64Array(Number(ipRangeLength));
|
||||
let iterIp = startIp;
|
||||
for (let i = 0; i < ipRangeLength; i++) {
|
||||
allIps[i] = iterIp++;
|
||||
}
|
||||
|
||||
return merge(Array.from(allIps, ip => stringifyIp({ number: ip, version })));
|
||||
}
|
||||
catch (e) {
|
||||
return [];
|
||||
}
|
||||
});
|
||||
|
||||
const startIpValidation = useValidation({
|
||||
source: rawStartAddress,
|
||||
rules: [{ message: 'Invalid ipv4/6 address', validator: ip => isIP(ip) }],
|
||||
});
|
||||
const endIpValidation = useValidation({
|
||||
source: rawEndAddress,
|
||||
rules: [{ message: 'Invalid ipv4/6 address', validator: ip => isIP(ip) }],
|
||||
});
|
||||
|
||||
const showResult = computed(() => endIpValidation.isValid && startIpValidation.isValid && result.value.length > 0);
|
||||
|
||||
function onSwitchStartEndClicked() {
|
||||
const tmpStart = rawStartAddress.value;
|
||||
rawStartAddress.value = rawEndAddress.value;
|
||||
rawEndAddress.value = tmpStart;
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div>
|
||||
<n-grid cols="4" x-gap="12" mb-6 w-full>
|
||||
<n-gi span="2">
|
||||
<c-input-text
|
||||
v-model:value="rawStartAddress"
|
||||
label="Start address"
|
||||
placeholder="Start IPv4/6 address..."
|
||||
:validation="startIpValidation"
|
||||
clearable
|
||||
/>
|
||||
</n-gi>
|
||||
<n-gi span="2">
|
||||
<c-input-text
|
||||
v-model:value="rawEndAddress"
|
||||
label="End address"
|
||||
placeholder="End IPv4/6 address..."
|
||||
:validation="endIpValidation"
|
||||
clearable
|
||||
/>
|
||||
</n-gi>
|
||||
</n-grid>
|
||||
|
||||
<c-card v-if="showResult" title="CIDR" data-test-id="result">
|
||||
<ul style="list-item-type: none">
|
||||
<li v-for="cidr in result" :key="cidr">
|
||||
{{ cidr }}
|
||||
</li>
|
||||
</ul>
|
||||
</c-card>
|
||||
<n-alert
|
||||
v-else-if="startIpValidation.isValid && endIpValidation.isValid && isReversed"
|
||||
title="Invalid combination of start and end IPv4/6 address"
|
||||
type="error"
|
||||
>
|
||||
<div my-3 op-70>
|
||||
The end IPv4/6 address is lower than the start IPv4/6 address. This is not valid and no result could be calculated.
|
||||
In the most cases the solution to solve this problem is to change start and end address.
|
||||
</div>
|
||||
|
||||
<c-button @click="onSwitchStartEndClicked">
|
||||
<n-icon mr-2 :component="Exchange" depth="3" size="22" />
|
||||
Switch start and end IPv4/6 address
|
||||
</c-button>
|
||||
</n-alert>
|
||||
<n-alert
|
||||
v-else-if="isNotSameVersion"
|
||||
title="Invalid combination of IP version 4/6"
|
||||
type="error"
|
||||
>
|
||||
<div my-3 op-70>
|
||||
Start IP and End IP must be of same version: IPv4 or IPv6
|
||||
</div>
|
||||
</n-alert>
|
||||
</div>
|
||||
</template>
|
||||
Reference in new issue
Block a user