diff --git a/components.d.ts b/components.d.ts index 3e65c3cc5..742dcaf61 100644 --- a/components.d.ts +++ b/components.d.ts @@ -101,6 +101,7 @@ declare module '@vue/runtime-core' { IconMdiSearch: typeof import('~icons/mdi/search')['default'] IconMdiTranslate: typeof import('~icons/mdi/translate')['default'] IconMdiTriangleDown: typeof import('~icons/mdi/triangle-down')['default'] + ImageResizer: typeof import('./src/tools/image-resizer/image-resizer.vue')['default'] InputCopyable: typeof import('./src/components/InputCopyable.vue')['default'] IntegerBaseConverter: typeof import('./src/tools/integer-base-converter/integer-base-converter.vue')['default'] Ipv4AddressConverter: typeof import('./src/tools/ipv4-address-converter/ipv4-address-converter.vue')['default'] diff --git a/locales/en.yml b/locales/en.yml index 9f54a259a..1d860e62e 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -391,3 +391,7 @@ tools: text-to-binary: title: Text to ASCII binary description: Convert text to its ASCII binary representation and vice-versa. + + image-resizer: + title: Image resizer + description: Convert the width and height of an image file, preview, and download it in a desired format (.jpg, .jpeg, .png, .bmp, .ico, .svg) \ No newline at end of file diff --git a/src/tools/image-resizer/image-resizer.vue b/src/tools/image-resizer/image-resizer.vue new file mode 100644 index 000000000..3c88ff1be --- /dev/null +++ b/src/tools/image-resizer/image-resizer.vue @@ -0,0 +1,197 @@ + + + + + + + + + + + Original Image Dimensions: {{ originalImageWidth }}x{{ originalImageHeight }}px + + + + + Width (px): + + + + + Height (px): + + + + + + + + + + Preview: {{ imageWidth }}x{{ imageHeight }}px + + + Download Options: + + + Download JPG + + + Download PNG + + + Download BMP + + + Download SVG + + + Download ICO + + + + + + + diff --git a/src/tools/image-resizer/index.ts b/src/tools/image-resizer/index.ts new file mode 100644 index 000000000..4e173c609 --- /dev/null +++ b/src/tools/image-resizer/index.ts @@ -0,0 +1,12 @@ +import { Resize } from '@vicons/tabler'; +import { defineTool } from '../tool'; + +export const tool = defineTool({ + name: 'Image resizer', + path: '/image-resizer', + description: '', + keywords: ['image', 'resizer', 'favicon', 'jpg', 'jpeg', 'png', 'bmp', 'ico', 'svg'], + component: () => import('./image-resizer.vue'), + icon: Resize, + createdAt: new Date('2024-10-22'), +}); diff --git a/src/tools/index.ts b/src/tools/index.ts index 388cfaf49..997f53318 100644 --- a/src/tools/index.ts +++ b/src/tools/index.ts @@ -1,6 +1,7 @@ import { tool as base64FileConverter } from './base64-file-converter'; import { tool as base64StringConverter } from './base64-string-converter'; import { tool as basicAuthGenerator } from './basic-auth-generator'; +import { tool as imageResizer } from './image-resizer'; import { tool as emailNormalizer } from './email-normalizer'; import { tool as asciiTextDrawer } from './ascii-text-drawer'; @@ -141,7 +142,13 @@ export const toolsByCategory: ToolCategory[] = [ }, { name: 'Images and videos', - components: [qrCodeGenerator, wifiQrCodeGenerator, svgPlaceholderGenerator, cameraRecorder], + components: [ + qrCodeGenerator, + wifiQrCodeGenerator, + svgPlaceholderGenerator, + cameraRecorder, + imageResizer, + ], }, { name: 'Development',
Original Image Dimensions: {{ originalImageWidth }}x{{ originalImageHeight }}px
Preview: {{ imageWidth }}x{{ imageHeight }}px