@jjlmoya/utils-converters 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (172) hide show
  1. package/package.json +61 -0
  2. package/src/category/i18n/en.ts +90 -0
  3. package/src/category/i18n/es.ts +90 -0
  4. package/src/category/i18n/fr.ts +90 -0
  5. package/src/category/index.ts +39 -0
  6. package/src/category/seo.astro +15 -0
  7. package/src/components/PreviewNavSidebar.astro +116 -0
  8. package/src/components/PreviewToolbar.astro +152 -0
  9. package/src/data.ts +34 -0
  10. package/src/env.d.ts +5 -0
  11. package/src/index.ts +39 -0
  12. package/src/layouts/PreviewLayout.astro +117 -0
  13. package/src/pages/[locale]/[slug].astro +148 -0
  14. package/src/pages/[locale].astro +271 -0
  15. package/src/pages/index.astro +4 -0
  16. package/src/shared/ImageConverter.astro +237 -0
  17. package/src/shared/logic/converter.ts +167 -0
  18. package/src/shared/style.css +258 -0
  19. package/src/tests/faq_count.test.ts +10 -0
  20. package/src/tests/mocks/astro_mock.js +2 -0
  21. package/src/tests/seo_length.test.ts +22 -0
  22. package/src/tests/tool_validation.test.ts +17 -0
  23. package/src/tool/avifAJpg/bibliography.astro +14 -0
  24. package/src/tool/avifAJpg/component.astro +8 -0
  25. package/src/tool/avifAJpg/i18n/en.ts +123 -0
  26. package/src/tool/avifAJpg/i18n/es.ts +123 -0
  27. package/src/tool/avifAJpg/i18n/fr.ts +118 -0
  28. package/src/tool/avifAJpg/index.ts +29 -0
  29. package/src/tool/avifAJpg/seo.astro +14 -0
  30. package/src/tool/avifAPng/bibliography.astro +14 -0
  31. package/src/tool/avifAPng/component.astro +8 -0
  32. package/src/tool/avifAPng/i18n/en.ts +118 -0
  33. package/src/tool/avifAPng/i18n/es.ts +123 -0
  34. package/src/tool/avifAPng/i18n/fr.ts +118 -0
  35. package/src/tool/avifAPng/index.ts +29 -0
  36. package/src/tool/avifAPng/seo.astro +14 -0
  37. package/src/tool/avifAWebp/bibliography.astro +14 -0
  38. package/src/tool/avifAWebp/component.astro +8 -0
  39. package/src/tool/avifAWebp/i18n/en.ts +118 -0
  40. package/src/tool/avifAWebp/i18n/es.ts +123 -0
  41. package/src/tool/avifAWebp/i18n/fr.ts +118 -0
  42. package/src/tool/avifAWebp/index.ts +29 -0
  43. package/src/tool/avifAWebp/seo.astro +14 -0
  44. package/src/tool/bmpAJpg/bibliography.astro +14 -0
  45. package/src/tool/bmpAJpg/component.astro +8 -0
  46. package/src/tool/bmpAJpg/i18n/en.ts +123 -0
  47. package/src/tool/bmpAJpg/i18n/es.ts +123 -0
  48. package/src/tool/bmpAJpg/i18n/fr.ts +118 -0
  49. package/src/tool/bmpAJpg/index.ts +29 -0
  50. package/src/tool/bmpAJpg/seo.astro +14 -0
  51. package/src/tool/bmpAPng/bibliography.astro +14 -0
  52. package/src/tool/bmpAPng/component.astro +8 -0
  53. package/src/tool/bmpAPng/i18n/en.ts +123 -0
  54. package/src/tool/bmpAPng/i18n/es.ts +123 -0
  55. package/src/tool/bmpAPng/i18n/fr.ts +118 -0
  56. package/src/tool/bmpAPng/index.ts +29 -0
  57. package/src/tool/bmpAPng/seo.astro +14 -0
  58. package/src/tool/bmpAWebp/bibliography.astro +14 -0
  59. package/src/tool/bmpAWebp/component.astro +8 -0
  60. package/src/tool/bmpAWebp/i18n/en.ts +118 -0
  61. package/src/tool/bmpAWebp/i18n/es.ts +123 -0
  62. package/src/tool/bmpAWebp/i18n/fr.ts +118 -0
  63. package/src/tool/bmpAWebp/index.ts +29 -0
  64. package/src/tool/bmpAWebp/seo.astro +14 -0
  65. package/src/tool/gifAJpg/bibliography.astro +14 -0
  66. package/src/tool/gifAJpg/component.astro +8 -0
  67. package/src/tool/gifAJpg/i18n/en.ts +123 -0
  68. package/src/tool/gifAJpg/i18n/es.ts +123 -0
  69. package/src/tool/gifAJpg/i18n/fr.ts +118 -0
  70. package/src/tool/gifAJpg/index.ts +29 -0
  71. package/src/tool/gifAJpg/seo.astro +14 -0
  72. package/src/tool/gifAPng/bibliography.astro +14 -0
  73. package/src/tool/gifAPng/component.astro +8 -0
  74. package/src/tool/gifAPng/i18n/en.ts +123 -0
  75. package/src/tool/gifAPng/i18n/es.ts +123 -0
  76. package/src/tool/gifAPng/i18n/fr.ts +118 -0
  77. package/src/tool/gifAPng/index.ts +29 -0
  78. package/src/tool/gifAPng/seo.astro +14 -0
  79. package/src/tool/gifAWebp/bibliography.astro +14 -0
  80. package/src/tool/gifAWebp/component.astro +8 -0
  81. package/src/tool/gifAWebp/i18n/en.ts +123 -0
  82. package/src/tool/gifAWebp/i18n/es.ts +123 -0
  83. package/src/tool/gifAWebp/i18n/fr.ts +118 -0
  84. package/src/tool/gifAWebp/index.ts +29 -0
  85. package/src/tool/gifAWebp/seo.astro +14 -0
  86. package/src/tool/imagenBase64/bibliography.astro +14 -0
  87. package/src/tool/imagenBase64/component.astro +159 -0
  88. package/src/tool/imagenBase64/i18n/en.ts +137 -0
  89. package/src/tool/imagenBase64/i18n/es.ts +137 -0
  90. package/src/tool/imagenBase64/i18n/fr.ts +132 -0
  91. package/src/tool/imagenBase64/index.ts +43 -0
  92. package/src/tool/imagenBase64/seo.astro +14 -0
  93. package/src/tool/imagenBase64/style.css +299 -0
  94. package/src/tool/jpgAIco/bibliography.astro +14 -0
  95. package/src/tool/jpgAIco/component.astro +8 -0
  96. package/src/tool/jpgAIco/i18n/en.ts +123 -0
  97. package/src/tool/jpgAIco/i18n/es.ts +123 -0
  98. package/src/tool/jpgAIco/i18n/fr.ts +118 -0
  99. package/src/tool/jpgAIco/index.ts +29 -0
  100. package/src/tool/jpgAIco/seo.astro +14 -0
  101. package/src/tool/jpgAPng/bibliography.astro +14 -0
  102. package/src/tool/jpgAPng/component.astro +8 -0
  103. package/src/tool/jpgAPng/i18n/en.ts +128 -0
  104. package/src/tool/jpgAPng/i18n/es.ts +128 -0
  105. package/src/tool/jpgAPng/i18n/fr.ts +123 -0
  106. package/src/tool/jpgAPng/index.ts +29 -0
  107. package/src/tool/jpgAPng/seo.astro +14 -0
  108. package/src/tool/jpgAWebp/bibliography.astro +14 -0
  109. package/src/tool/jpgAWebp/component.astro +8 -0
  110. package/src/tool/jpgAWebp/i18n/en.ts +118 -0
  111. package/src/tool/jpgAWebp/i18n/es.ts +123 -0
  112. package/src/tool/jpgAWebp/i18n/fr.ts +118 -0
  113. package/src/tool/jpgAWebp/index.ts +29 -0
  114. package/src/tool/jpgAWebp/seo.astro +14 -0
  115. package/src/tool/pngAIco/bibliography.astro +14 -0
  116. package/src/tool/pngAIco/component.astro +8 -0
  117. package/src/tool/pngAIco/i18n/en.ts +123 -0
  118. package/src/tool/pngAIco/i18n/es.ts +123 -0
  119. package/src/tool/pngAIco/i18n/fr.ts +118 -0
  120. package/src/tool/pngAIco/index.ts +29 -0
  121. package/src/tool/pngAIco/seo.astro +14 -0
  122. package/src/tool/pngAJpg/bibliography.astro +14 -0
  123. package/src/tool/pngAJpg/component.astro +8 -0
  124. package/src/tool/pngAJpg/i18n/en.ts +133 -0
  125. package/src/tool/pngAJpg/i18n/es.ts +201 -0
  126. package/src/tool/pngAJpg/i18n/fr.ts +128 -0
  127. package/src/tool/pngAJpg/index.ts +29 -0
  128. package/src/tool/pngAJpg/seo.astro +14 -0
  129. package/src/tool/pngAWebp/bibliography.astro +14 -0
  130. package/src/tool/pngAWebp/component.astro +8 -0
  131. package/src/tool/pngAWebp/i18n/en.ts +127 -0
  132. package/src/tool/pngAWebp/i18n/es.ts +132 -0
  133. package/src/tool/pngAWebp/i18n/fr.ts +122 -0
  134. package/src/tool/pngAWebp/index.ts +29 -0
  135. package/src/tool/pngAWebp/seo.astro +14 -0
  136. package/src/tool/svgAJpg/bibliography.astro +14 -0
  137. package/src/tool/svgAJpg/component.astro +8 -0
  138. package/src/tool/svgAJpg/i18n/en.ts +118 -0
  139. package/src/tool/svgAJpg/i18n/es.ts +123 -0
  140. package/src/tool/svgAJpg/i18n/fr.ts +118 -0
  141. package/src/tool/svgAJpg/index.ts +29 -0
  142. package/src/tool/svgAJpg/seo.astro +14 -0
  143. package/src/tool/svgAPng/bibliography.astro +14 -0
  144. package/src/tool/svgAPng/component.astro +8 -0
  145. package/src/tool/svgAPng/i18n/en.ts +123 -0
  146. package/src/tool/svgAPng/i18n/es.ts +128 -0
  147. package/src/tool/svgAPng/i18n/fr.ts +118 -0
  148. package/src/tool/svgAPng/index.ts +29 -0
  149. package/src/tool/svgAPng/seo.astro +14 -0
  150. package/src/tool/webpAIco/bibliography.astro +14 -0
  151. package/src/tool/webpAIco/component.astro +8 -0
  152. package/src/tool/webpAIco/i18n/en.ts +123 -0
  153. package/src/tool/webpAIco/i18n/es.ts +123 -0
  154. package/src/tool/webpAIco/i18n/fr.ts +118 -0
  155. package/src/tool/webpAIco/index.ts +29 -0
  156. package/src/tool/webpAIco/seo.astro +14 -0
  157. package/src/tool/webpAJpg/bibliography.astro +14 -0
  158. package/src/tool/webpAJpg/component.astro +8 -0
  159. package/src/tool/webpAJpg/i18n/en.ts +122 -0
  160. package/src/tool/webpAJpg/i18n/es.ts +127 -0
  161. package/src/tool/webpAJpg/i18n/fr.ts +122 -0
  162. package/src/tool/webpAJpg/index.ts +29 -0
  163. package/src/tool/webpAJpg/seo.astro +14 -0
  164. package/src/tool/webpAPng/bibliography.astro +14 -0
  165. package/src/tool/webpAPng/component.astro +8 -0
  166. package/src/tool/webpAPng/i18n/en.ts +127 -0
  167. package/src/tool/webpAPng/i18n/es.ts +132 -0
  168. package/src/tool/webpAPng/i18n/fr.ts +122 -0
  169. package/src/tool/webpAPng/index.ts +29 -0
  170. package/src/tool/webpAPng/seo.astro +14 -0
  171. package/src/tools.ts +70 -0
  172. package/src/types.ts +69 -0
@@ -0,0 +1,29 @@
1
+ import type { ConvertersToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
+ import type { ImageConverterUI } from '../../shared/ImageConverter.astro';
3
+ import PngAIcoCalculator from './component.astro';
4
+ import PngAIcoSEO from './seo.astro';
5
+ import PngAIcoBibliography from './bibliography.astro';
6
+
7
+ export type PngAIcoLocaleContent = ToolLocaleContent<ImageConverterUI>;
8
+
9
+ export const pngAIco: ConvertersToolEntry<ImageConverterUI> = {
10
+ id: 'png-a-ico',
11
+ icons: {
12
+ bg: 'mdi:file-image',
13
+ fg: 'mdi:file-export',
14
+ },
15
+ i18n: {
16
+ es: () => import('./i18n/es').then((m) => m.content),
17
+ en: () => import('./i18n/en').then((m) => m.content),
18
+ fr: () => import('./i18n/fr').then((m) => m.content),
19
+ },
20
+ };
21
+
22
+ export { PngAIcoCalculator, PngAIcoSEO, PngAIcoBibliography };
23
+
24
+ export const PNG_A_ICO_TOOL: ToolDefinition = {
25
+ entry: pngAIco,
26
+ Component: PngAIcoCalculator,
27
+ SEOComponent: PngAIcoSEO,
28
+ BibliographyComponent: PngAIcoBibliography,
29
+ };
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { SEORenderer } from '@jjlmoya/utils-shared';
3
+ import { pngAIco } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await pngAIco.i18n[locale]?.();
12
+ ---
13
+
14
+ {content && <SEORenderer content={{ locale, sections: content.seo }} />}
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
3
+ import { pngAJpg } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await pngAJpg.i18n[locale]?.();
12
+ ---
13
+
14
+ {content && <SharedBibliography links={content.bibliography} title={content.ui.bibliographyTitle} />}
@@ -0,0 +1,8 @@
1
+ ---
2
+ import SharedImageConverter from '../../shared/ImageConverter.astro';
3
+ import type { ImageConverterUI } from '../../shared/ImageConverter.astro';
4
+
5
+ interface Props { ui: ImageConverterUI }
6
+ const { ui } = Astro.props;
7
+ ---
8
+ <SharedImageConverter from="png" to="jpg" ui={ui} />
@@ -0,0 +1,133 @@
1
+ import type { WithContext, SoftwareApplication } from 'schema-dts';
2
+ import type { ImageConverterUI } from '../../../shared/ImageConverter.astro';
3
+ import type { PngAJpgLocaleContent } from '../index';
4
+
5
+ const slug = 'png-to-jpg-converter';
6
+ const title = 'Convert PNG to JPG Online - Fast, Free and 100% Private';
7
+ const description =
8
+ 'Convert PNG images to JPG directly in your browser. No file uploads to servers. Fast, free and completely private.';
9
+
10
+ const ui: ImageConverterUI = {
11
+ dragText: 'Drag PNG files...',
12
+ convertText: 'To convert them to JPG instantly',
13
+ selectFiles: 'Select files',
14
+ processedFiles: 'Processed files',
15
+ downloadAll: 'Download All (.zip)',
16
+ pending: 'Pending',
17
+ bibliographyTitle: 'Bibliographic References',
18
+ faqTitle: 'Frequently Asked Questions',
19
+ };
20
+
21
+ const faq: PngAJpgLocaleContent['faq'] = [
22
+ {
23
+ question: 'Why convert PNG to JPG?',
24
+ answer:
25
+ 'PNG maintains high quality and transparency but results in large files. Converting to JPG is perfect when you need lightweight photos for emails or fast websites and a solid background is acceptable.',
26
+ },
27
+ {
28
+ question: 'Will I lose details during the conversion?',
29
+ answer:
30
+ 'We apply a balanced high-quality compression ratio, so differences in photographs and gradients will be almost imperceptible to the eye, but you will notice the savings in the final file size.',
31
+ },
32
+ {
33
+ question: 'Are my photos processed securely?',
34
+ answer:
35
+ 'Absolutely yes. We do not use cloud servers; the conversion algorithm runs through the HTML5 Canvas of your own web browser in an isolated environment.',
36
+ },
37
+ ];
38
+
39
+ const howTo: PngAJpgLocaleContent['howTo'] = [
40
+ {
41
+ name: 'Drag PNG Files',
42
+ text: 'Send your static PNG images to the local processing box by dropping them there.',
43
+ },
44
+ {
45
+ name: 'White Re-Rendering',
46
+ text: 'Each photo automatically adapts its transparency with an underlying white layer to make it compatible with the JPG environment.',
47
+ },
48
+ {
49
+ name: 'Direct Export',
50
+ text: 'Click the green download icons and save your new JPG files.',
51
+ },
52
+ ];
53
+
54
+ const bibliography: PngAJpgLocaleContent['bibliography'] = [
55
+ {
56
+ name: 'PNG Consortium Specifications',
57
+ url: 'http://www.libpng.org/pub/png/',
58
+ },
59
+ {
60
+ name: 'The JPEG committee',
61
+ url: 'https://jpeg.org/',
62
+ },
63
+ ];
64
+
65
+ const seo: PngAJpgLocaleContent['seo'] = [
66
+ {
67
+ type: 'title',
68
+ text: 'Free Online PNG to JPG Converter',
69
+ },
70
+ {
71
+ type: 'paragraph',
72
+ html:
73
+ 'PNG (Portable Network Graphics) is widely used for its lossless quality and transparency (alpha channel) support. However, this fidelity comes at a cost: PNG files are considerably larger than their JPG equivalents, especially for photographs or images with complex gradients.',
74
+ },
75
+ {
76
+ type: 'paragraph',
77
+ html:
78
+ 'JPG (or JPEG) uses a lossy compression algorithm that drastically reduces file size. For photographs and images where a small loss of detail is acceptable, JPG is the standard choice. A 2 MB PNG can become a 200 KB JPG with virtually identical visual quality.',
79
+ },
80
+ {
81
+ type: 'paragraph',
82
+ html:
83
+ 'Our PNG to JPG converter works entirely in your web browser using the HTML5 Canvas API. The process is simple: the PNG image is loaded into memory, drawn on a virtual canvas, and exported as JPG at optimal quality. Transparent areas in the PNG are replaced with a solid white background, as the JPG format does not support the alpha channel.',
84
+ },
85
+ {
86
+ type: 'tip',
87
+ html:
88
+ 'For images with text or logos requiring transparent backgrounds, consider using WebP instead of JPG. WebP offers similar compression but retains transparency support.',
89
+ },
90
+ {
91
+ type: 'paragraph',
92
+ html:
93
+ 'JPG can reduce the size of a photographic image by 70% to 90% compared to PNG, depending on image complexity and the quality settings applied.',
94
+ },
95
+ {
96
+ type: 'paragraph',
97
+ html:
98
+ 'Typical use cases for converting PNG to JPG include: preparing images for email where size matters, optimizing product photos for online stores, reducing screenshot weight before sharing, and compressing images for faster web page loading.',
99
+ },
100
+ {
101
+ type: 'paragraph',
102
+ html:
103
+ 'Privacy is a priority in our tool. Unlike online converters that upload your files to remote servers, our converter processes everything locally on your device. Your images never leave your computer, which is especially important for corporate documents, personal photos, or any sensitive material.',
104
+ },
105
+ {
106
+ type: 'paragraph',
107
+ html:
108
+ 'Convert PNG to JPG instantly, for free, and privately directly in your browser. No registration, no limits, and without compromising the security of your files.',
109
+ },
110
+ ];
111
+
112
+ const appSchema: WithContext<SoftwareApplication> = {
113
+ '@context': 'https://schema.org',
114
+ '@type': 'SoftwareApplication',
115
+ name: title,
116
+ description,
117
+ applicationCategory: 'UtilitiesApplication',
118
+ operatingSystem: 'Web',
119
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
120
+ inLanguage: 'en',
121
+ };
122
+
123
+ export const content: PngAJpgLocaleContent = {
124
+ slug,
125
+ title,
126
+ description,
127
+ ui,
128
+ seo,
129
+ faq,
130
+ bibliography,
131
+ howTo,
132
+ schemas: [appSchema as any],
133
+ };
@@ -0,0 +1,201 @@
1
+ import type { WithContext, SoftwareApplication } from 'schema-dts';
2
+ import type { ImageConverterUI } from '../../../shared/ImageConverter.astro';
3
+ import type { PngAJpgLocaleContent } from '../index';
4
+
5
+ const slug = 'convertidor-png-a-jpg';
6
+ const title = 'Convertir PNG a JPG Online - Rápido, Gratis y 100% Privado';
7
+ const description =
8
+ 'Convierte tus imágenes PNG a formato JPG de compresión rápida al instante en tu propio ordenador. Sin subir fotos a internet. Optimización por lotes.';
9
+
10
+ const ui: ImageConverterUI = {
11
+ dragText: 'Arrastra archivos PNG...',
12
+ convertText: 'Para convertirlos a JPG al instante',
13
+ selectFiles: 'Seleccionar archivos',
14
+ processedFiles: 'Archivos procesados',
15
+ downloadAll: 'Descargar Todo (.zip)',
16
+ pending: 'Pendiente',
17
+ bibliographyTitle: 'Referencias Bibliográficas',
18
+ faqTitle: 'Preguntas Frecuentes',
19
+ };
20
+
21
+ const faq: PngAJpgLocaleContent['faq'] = [
22
+ {
23
+ question: '¿Por qué elegir nuestro convertidor local de PNG a JPG?',
24
+ answer:
25
+ 'A diferencia de las herramientas convencionales, nuestra utilidad procesa los archivos íntegramente en tu navegador. Tus imágenes nunca tocan un disco duro ajeno, garantizando la total soberanía y privacidad de tus datos.',
26
+ },
27
+ {
28
+ question: '¿JPG o PNG? ¿Cuál es mejor para mi caso?',
29
+ answer:
30
+ 'El PNG es ideal para logotipos y elementos con transparencia. Sin embargo, el JPG es el estándar de oro para fotografías y banners web, ya que logra pesos mucho más reducidos, mejorando drásticamente la velocidad de carga de un sitio.',
31
+ },
32
+ {
33
+ question: '¿Cómo funciona la conversión técnica sin subir nada?',
34
+ answer:
35
+ 'Utilizamos la potencia del Canvas de HTML5. El navegador recrea la imagen en un lienzo virtual invisible, rellena las transparencias con blanco y genera un flujo de bytes que descargas directamente al instante.',
36
+ },
37
+ {
38
+ question: '¿Es seguro para documentos confidenciales?',
39
+ answer:
40
+ 'Sí, es la opción más segura para profesionales de la banca, salud o derecho. Al ser una "caja negra" que solo usa tu RAM, lo que pasa dentro muere al cerrar la pestaña, evitando filtraciones en nubes de terceros.',
41
+ },
42
+ ];
43
+
44
+ const howTo: PngAJpgLocaleContent['howTo'] = [
45
+ {
46
+ name: 'Selección de archivos',
47
+ text: 'Prepara tus archivos PNG en una carpeta y arrástralos todos juntos al área de procesamiento o búscalos con el explorador.',
48
+ },
49
+ {
50
+ name: 'Procesamiento instantáneo',
51
+ text: 'Verifica que el estado cambie a "Listo" para cada archivo mientras el navegador optimiza el peso localmente.',
52
+ },
53
+ {
54
+ name: 'Descarga optimizada',
55
+ text: 'Guarda tus nuevos JPG uno a uno o usa el botón "Descargar Todo" para obtener un archivo ZIP comprimido con todas las imágenes.',
56
+ },
57
+ ];
58
+
59
+ const bibliography: PngAJpgLocaleContent['bibliography'] = [
60
+ {
61
+ name: 'Especificaciones PNG Consortium',
62
+ url: 'http://www.libpng.org/pub/png/',
63
+ },
64
+ {
65
+ name: 'The JPEG committee',
66
+ url: 'https://jpeg.org/',
67
+ },
68
+ ];
69
+
70
+ const seo: PngAJpgLocaleContent['seo'] = [
71
+ {
72
+ type: 'title',
73
+ text: 'Convertidor de PNG a JPG: La Guía Definitiva para la Optimización de Imágenes',
74
+ level: 2,
75
+ },
76
+ {
77
+ type: 'paragraph',
78
+ html: 'En el mundo del diseño digital y el desarrollo web, la eficiencia lo es todo. El formato PNG (Portable Network Graphics) es amado por su capacidad de mantener transparencias y su compresión sin pérdida, pero tiene un gran enemigo: el peso del archivo. Cuando necesitas que tu sitio web vuele o que tus emails carguen instantáneamente, el paso de PNG a JPG es la decisión técnica más inteligente.',
79
+ },
80
+ {
81
+ type: 'title',
82
+ text: '¿JPG o PNG?',
83
+ level: 3,
84
+ },
85
+ {
86
+ type: 'paragraph',
87
+ html: 'No existe un formato mejor que otro, sino una herramienta para cada necesidad. El PNG es un formato sin pérdida, ideal para maquetas de interfaces, logotipos con texto pequeño y elementos visuales que requieren un fondo transparente. Sin embargo, esta fidelidad tiene un coste: archivos que pueden ser 5 o 10 veces más pesados que su equivalente comprimido.',
88
+ },
89
+ {
90
+ type: 'paragraph',
91
+ html: 'El JPG (Joint Photographic Experts Group), por otro lado, utiliza algoritmos de discretización para eliminar información que el ojo humano apenas percibe, logrando pesos pluma. Es el estándar de oro para fotografías, banners publicitarios y redes sociales. Al convertir tus PNG a JPG, estás traduciendo fidelidad geométrica por velocidad de red.',
92
+ },
93
+ {
94
+ type: 'title',
95
+ text: 'Comparativa de Arquitectura: Local vs Nube',
96
+ level: 3,
97
+ },
98
+ {
99
+ type: 'comparative',
100
+ items: [
101
+ {
102
+ title: 'Convertidores Cloud',
103
+ description: 'Herramientas tradicionales que suben tus fotos a un servidor remoto.',
104
+ icon: 'mdi:cloud-upload',
105
+ pointIcon: 'mdi:close-circle-outline',
106
+ points: [
107
+ 'Latencia de red (Upload/Download)',
108
+ 'Riesgo de filtración de datos privados',
109
+ 'Límites de tamaño por archivo',
110
+ 'Publicidad y rastreadores',
111
+ ],
112
+ },
113
+ {
114
+ title: 'Nuestra Arquitectura Local',
115
+ description: 'Procesamiento directo en tu hardware mediante tecnología Vanilla JS.',
116
+ icon: 'mdi:laptop-mac',
117
+ highlight: true,
118
+ points: [
119
+ 'Velocidad instantánea sin red',
120
+ 'Privacidad garantizada (0 bytes enviados)',
121
+ 'Sin límites de MB por archivo',
122
+ 'Interfaz profesional y limpia',
123
+ ],
124
+ },
125
+ ],
126
+ },
127
+ {
128
+ type: 'title',
129
+ text: 'Cómo funciona la conversión técnica',
130
+ level: 3,
131
+ },
132
+ {
133
+ type: 'paragraph',
134
+ html: 'Probablemente te preguntes cómo es posible convertir una imagen sin enviarla a un servidor. La magia reside en la potencia de los navegadores modernos. Cuando seleccionas un archivo, generamos un Blob que solo existe en tu RAM. Ese Blob se dibuja en un elemento HTML5 Canvas invisible.',
135
+ },
136
+ {
137
+ type: 'paragraph',
138
+ html: 'Dado que el JPG no soporta transparencias, nuestro algoritmo rellena el fondo con un color blanco sólido antes de "pintar" el PNG encima. Una vez compuesta la imagen, ejecutamos el método de exportación nativo, generando un flujo de bytes que tu ordenador descarga directamente.',
139
+ },
140
+ {
141
+ type: 'tip',
142
+ title: 'Consejo SEO: El Peso Ideal',
143
+ html: 'Google penaliza activamente los sitios web lentos. Si tu Largest Contentful Paint (LCP) es alto por culpa de un PNG de cabecera de 2MB, convertirlo a un JPG de 200KB puede mejorar tus métricas de PageSpeed instantáneamente sin diferencias visuales.',
144
+ },
145
+ {
146
+ type: 'title',
147
+ text: 'Seguridad para Empresas y Profesionales',
148
+ level: 3,
149
+ },
150
+ {
151
+ type: 'paragraph',
152
+ html: 'Si trabajas en sectores sensibles como la banca, la salud o el derecho, subir archivos a conversores online es una violación de seguridad. Nuestra herramienta funciona como una "caja negra": lo que pasa dentro se queda en tu RAM. Es la única forma segura de trabajar con documentos confidenciales.',
153
+ },
154
+ {
155
+ type: 'title',
156
+ text: 'Compatibilidad del Resultado',
157
+ level: 3,
158
+ },
159
+ {
160
+ type: 'list',
161
+ icon: 'mdi:check-circle',
162
+ items: [
163
+ 'Visores de Windows, macOS y dispositivos móviles.',
164
+ 'Redes sociales (Instagram, LinkedIn, etc).',
165
+ 'Herramientas de ofimática (Word, PowerPoint).',
166
+ 'Gestores de contenido (WordPress, Shopify).',
167
+ ],
168
+ },
169
+ {
170
+ type: 'title',
171
+ text: 'Conclusión: Optimiza como un Pro',
172
+ level: 3,
173
+ },
174
+ {
175
+ type: 'paragraph',
176
+ html: 'Este convertidor no es solo una página más; es una pieza de ingeniería diseñada para facilitarte la vida. Ya seas un desarrollador o un usuario doméstico, aquí tienes la solución definitiva para ahorrar megabytes y mantener tus datos a salvo.',
177
+ },
178
+ ];
179
+
180
+ const appSchema: WithContext<SoftwareApplication> = {
181
+ '@context': 'https://schema.org',
182
+ '@type': 'SoftwareApplication',
183
+ name: title,
184
+ description,
185
+ applicationCategory: 'UtilitiesApplication',
186
+ operatingSystem: 'Web',
187
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
188
+ inLanguage: 'es',
189
+ };
190
+
191
+ export const content: PngAJpgLocaleContent = {
192
+ slug,
193
+ title,
194
+ description,
195
+ ui,
196
+ seo,
197
+ faq,
198
+ bibliography,
199
+ howTo,
200
+ schemas: [appSchema as any],
201
+ };
@@ -0,0 +1,128 @@
1
+ import type { WithContext, SoftwareApplication } from 'schema-dts';
2
+ import type { ImageConverterUI } from '../../../shared/ImageConverter.astro';
3
+ import type { PngAJpgLocaleContent } from '../index';
4
+
5
+ const slug = 'convertisseur-png-en-jpg';
6
+ const title = 'Convertir PNG en JPG en Ligne - Rapide, Gratuit et 100% Privé';
7
+ const description =
8
+ 'Convertissez des images PNG en JPG directement dans votre navigateur. Sans téléchargement vers des serveurs. Rapide, gratuit et totalement privé.';
9
+
10
+ const ui: ImageConverterUI = {
11
+ dragText: 'Faites glisser des fichiers PNG...',
12
+ convertText: 'Pour les convertir en JPG instantanément',
13
+ selectFiles: 'Sélectionner des fichiers',
14
+ processedFiles: 'Fichiers traités',
15
+ downloadAll: 'Tout télécharger (.zip)',
16
+ pending: 'En attente',
17
+ bibliographyTitle: 'Références Bibliographiques',
18
+ faqTitle: 'Questions Fréquentes',
19
+ };
20
+
21
+ const faq: PngAJpgLocaleContent['faq'] = [
22
+ {
23
+ question: 'Pourquoi convertir PNG en JPG ?',
24
+ answer:
25
+ 'Le format PNG maintient une haute qualité et la transparence, mais produit de gros fichiers. La conversion en JPG est idéale pour les photos légères dans les e-mails ou les sites web rapides lorsqu\'un fond solide est acceptable.',
26
+ },
27
+ {
28
+ question: 'Vais-je perdre des détails pendant la conversion ?',
29
+ answer:
30
+ 'Nous appliquons un taux de compression équilibré de haute qualité, de sorte que les différences dans les photographies et les dégradés seront presque imperceptibles à l\'œil, mais vous remarquerez l\'économie dans la taille finale du fichier.',
31
+ },
32
+ {
33
+ question: 'Mes photos sont-elles traitées en toute sécurité ?',
34
+ answer:
35
+ 'Absolument oui. Nous n\'utilisons pas de serveurs cloud ; l\'algorithme de conversion s\'exécute via le Canvas HTML5 de votre propre navigateur web de manière isolée.',
36
+ },
37
+ ];
38
+
39
+ const howTo: PngAJpgLocaleContent['howTo'] = [
40
+ {
41
+ name: 'Glisser les fichiers PNG',
42
+ text: 'Envoyez vos images PNG statiques dans la zone de traitement local en les déposant là.',
43
+ },
44
+ {
45
+ name: 'Re-rendu blanc',
46
+ text: 'Chaque photo adapte automatiquement sa transparence avec une couche blanche sous-jacente pour la rendre compatible avec l\'environnement JPG.',
47
+ },
48
+ {
49
+ name: 'Export direct',
50
+ text: 'Cliquez sur les icônes de téléchargement vertes et sauvegardez vos nouveaux fichiers JPG.',
51
+ },
52
+ ];
53
+
54
+ const bibliography: PngAJpgLocaleContent['bibliography'] = [
55
+ {
56
+ name: 'Spécifications du PNG Consortium',
57
+ url: 'http://www.libpng.org/pub/png/',
58
+ },
59
+ {
60
+ name: 'Le comité JPEG',
61
+ url: 'https://jpeg.org/',
62
+ },
63
+ ];
64
+
65
+ const seo: PngAJpgLocaleContent['seo'] = [
66
+ {
67
+ type: 'title',
68
+ text: 'Convertisseur PNG vers JPG en Ligne Gratuit',
69
+ },
70
+ {
71
+ type: 'paragraph',
72
+ html:
73
+ 'Le format PNG (Portable Network Graphics) est largement utilisé pour sa qualité sans perte et son support de la transparence (canal alpha). Cependant, cette fidélité a un coût : les fichiers PNG sont considérablement plus grands que leurs équivalents JPG, notamment pour les photographies ou les images avec des dégradés complexes.',
74
+ },
75
+ {
76
+ type: 'paragraph',
77
+ html:
78
+ 'Le JPG (ou JPEG) utilise un algorithme de compression avec perte qui réduit considérablement la taille du fichier. Pour les photographies et les images où une légère perte de détail est acceptable, JPG est le choix standard. Un PNG de 2 Mo peut devenir un JPG de 200 Ko avec une qualité visuelle pratiquement identique.',
79
+ },
80
+ {
81
+ type: 'paragraph',
82
+ html:
83
+ 'Notre convertisseur PNG vers JPG fonctionne entièrement dans votre navigateur via l\'API Canvas HTML5. Les zones transparentes du PNG original sont remplacées par un fond blanc solide, car le format JPG ne supporte pas le canal alpha.',
84
+ },
85
+ {
86
+ type: 'tip',
87
+ html:
88
+ 'Pour les images avec du texte ou des logos nécessitant des fonds transparents, envisagez d\'utiliser WebP plutôt que JPG. WebP offre une compression similaire mais conserve la transparence.',
89
+ },
90
+ {
91
+ type: 'paragraph',
92
+ html:
93
+ 'Le JPG peut réduire la taille d\'une image photographique de 70 % à 90 % par rapport au PNG, selon la complexité de l\'image et les paramètres de qualité appliqués.',
94
+ },
95
+ {
96
+ type: 'paragraph',
97
+ html:
98
+ 'Les cas d\'utilisation typiques pour la conversion PNG vers JPG comprennent : préparer des images pour l\'e-mail, optimiser les photos de produits pour les boutiques en ligne, réduire le poids des captures d\'écran avant de les partager, et compresser les images pour un chargement plus rapide des pages web.',
99
+ },
100
+ {
101
+ type: 'paragraph',
102
+ html:
103
+ 'Convertissez PNG en JPG instantanément, gratuitement et en toute confidentialité directement dans votre navigateur. Sans inscription, sans limites et sans compromettre la sécurité de vos fichiers.',
104
+ },
105
+ ];
106
+
107
+ const appSchema: WithContext<SoftwareApplication> = {
108
+ '@context': 'https://schema.org',
109
+ '@type': 'SoftwareApplication',
110
+ name: title,
111
+ description,
112
+ applicationCategory: 'UtilitiesApplication',
113
+ operatingSystem: 'Web',
114
+ offers: { '@type': 'Offer', price: '0', priceCurrency: 'EUR' },
115
+ inLanguage: 'fr',
116
+ };
117
+
118
+ export const content: PngAJpgLocaleContent = {
119
+ slug,
120
+ title,
121
+ description,
122
+ ui,
123
+ seo,
124
+ faq,
125
+ bibliography,
126
+ howTo,
127
+ schemas: [appSchema as any],
128
+ };
@@ -0,0 +1,29 @@
1
+ import type { ConvertersToolEntry, ToolLocaleContent, ToolDefinition } from '../../types';
2
+ import type { ImageConverterUI } from '../../shared/ImageConverter.astro';
3
+ import PngAJpgCalculator from './component.astro';
4
+ import PngAJpgSEO from './seo.astro';
5
+ import PngAJpgBibliography from './bibliography.astro';
6
+
7
+ export type PngAJpgLocaleContent = ToolLocaleContent<ImageConverterUI>;
8
+
9
+ export const pngAJpg: ConvertersToolEntry<ImageConverterUI> = {
10
+ id: 'png-a-jpg',
11
+ icons: {
12
+ bg: 'mdi:file-image',
13
+ fg: 'mdi:file-export',
14
+ },
15
+ i18n: {
16
+ es: () => import('./i18n/es').then((m) => m.content),
17
+ en: () => import('./i18n/en').then((m) => m.content),
18
+ fr: () => import('./i18n/fr').then((m) => m.content),
19
+ },
20
+ };
21
+
22
+ export { PngAJpgCalculator, PngAJpgSEO, PngAJpgBibliography };
23
+
24
+ export const PNG_A_JPG_TOOL: ToolDefinition = {
25
+ entry: pngAJpg,
26
+ Component: PngAJpgCalculator,
27
+ SEOComponent: PngAJpgSEO,
28
+ BibliographyComponent: PngAJpgBibliography,
29
+ };
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { SEORenderer } from '@jjlmoya/utils-shared';
3
+ import { pngAJpg } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await pngAJpg.i18n[locale]?.();
12
+ ---
13
+
14
+ {content && <SEORenderer content={{ locale, sections: content.seo }} />}
@@ -0,0 +1,14 @@
1
+ ---
2
+ import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
3
+ import { pngAWebp } from './index';
4
+ import type { KnownLocale } from '../../types';
5
+
6
+ interface Props {
7
+ locale?: KnownLocale;
8
+ }
9
+
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await pngAWebp.i18n[locale]?.();
12
+ ---
13
+
14
+ {content && <SharedBibliography links={content.bibliography} title={content.ui.bibliographyTitle} />}
@@ -0,0 +1,8 @@
1
+ ---
2
+ import SharedImageConverter from '../../shared/ImageConverter.astro';
3
+ import type { ImageConverterUI } from '../../shared/ImageConverter.astro';
4
+
5
+ interface Props { ui: ImageConverterUI }
6
+ const { ui } = Astro.props;
7
+ ---
8
+ <SharedImageConverter from="png" to="webp" ui={ui} />