mirror of
				https://github.com/C4illin/ConvertX.git
				synced 2025-10-31 03:53:30 +00:00 
			
		
		
		
	Compare commits
	
		
			5 Commits
		
	
	
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | d3af9688c6 | ||
|  | 7d0cbb9844 | ||
|  | 88173891ba | ||
|  | 2b4b8f9551 | ||
|  | 63a4328d4a | 
							
								
								
									
										12
									
								
								CHANGELOG.md
									
									
									
									
									
								
							
							
						
						
									
										12
									
								
								CHANGELOG.md
									
									
									
									
									
								
							| @@ -1,5 +1,17 @@ | ||||
| # Changelog | ||||
|  | ||||
| ## [0.7.0](https://github.com/C4illin/ConvertX/compare/v0.6.0...v0.7.0) (2024-09-26) | ||||
|  | ||||
|  | ||||
| ### Features | ||||
|  | ||||
| * Add support for 3d assets through assimp converter ([63a4328](https://github.com/C4illin/ConvertX/commit/63a4328d4a1e01df3e0ec4a877bad8c8ffe71129)) | ||||
|  | ||||
|  | ||||
| ### Bug Fixes | ||||
|  | ||||
| * wrong layout on search with few options ([8817389](https://github.com/C4illin/ConvertX/commit/88173891ba2d69da46eda46f3f598a9b54f26f96)) | ||||
|  | ||||
| ## [0.6.0](https://github.com/C4illin/ConvertX/compare/v0.5.0...v0.6.0) (2024-09-25) | ||||
|  | ||||
|  | ||||
|   | ||||
| @@ -49,7 +49,8 @@ RUN apk --no-cache add  \ | ||||
|   vips-tools \ | ||||
|   vips-poppler \ | ||||
|   vips-jxl \ | ||||
|   libjxl-tools | ||||
|   libjxl-tools \ | ||||
|   assimp | ||||
|  | ||||
| # this might be needed for some latex use cases, will add it if needed. | ||||
| #   texmf-dist-fontsextra \ | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
|  | ||||
|  | ||||
|  | ||||
| A self-hosted online file converter. Supports 831 different formats. Written with TypeScript, Bun and Elysia. | ||||
| A self-hosted online file converter. Supports over a thousand different formats. Written with TypeScript, Bun and Elysia. | ||||
|  | ||||
| ## Features | ||||
|  | ||||
| @@ -23,6 +23,7 @@ A self-hosted online file converter. Supports 831 different formats. Written wit | ||||
| | [libjxl](https://github.com/libjxl/libjxl)                                   | JPEG XL       | 11            | 11          | | ||||
| | [resvg](https://github.com/RazrFalcon/resvg)                                 | SVG           | 1             | 1           | | ||||
| | [Vips](https://github.com/libvips/libvips)                                   | Images        | 45            | 23          | | ||||
| | [Assimp](https://github.com/assimp/assimp)                                   | 3D Assets     | 70            | 24          | | ||||
| | [XeLaTeX](https://tug.org/xetex/)                                            | LaTeX         | 1             | 1           | | ||||
| | [Pandoc](https://pandoc.org/)                                                | Documents     | 43            | 65          | | ||||
| | [GraphicsMagick](http://www.graphicsmagick.org/)                             | Images        | 166           | 133         | | ||||
|   | ||||
| @@ -49,6 +49,7 @@ export default tseslint.config( | ||||
|           ], | ||||
|         }, | ||||
|       ], | ||||
|       "import/no-named-as-default": "off", | ||||
|     }, | ||||
|   }, | ||||
| ); | ||||
|   | ||||
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 52 KiB After Width: | Height: | Size: 53 KiB | 
| @@ -1,6 +1,6 @@ | ||||
| { | ||||
|   "name": "convertx-frontend", | ||||
|   "version": "0.6.0", | ||||
|   "version": "0.7.0", | ||||
|   "scripts": { | ||||
|     "dev": "bun run --watch src/index.tsx", | ||||
|     "hot": "bun run --hot src/index.tsx", | ||||
|   | ||||
							
								
								
									
										139
									
								
								src/converters/assimp.ts
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										139
									
								
								src/converters/assimp.ts
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,139 @@ | ||||
| import { exec } from "node:child_process"; | ||||
|  | ||||
| // This could be done dynamically by running `ffmpeg -formats` and parsing the output | ||||
| export const properties = { | ||||
|   from: { | ||||
|     muxer: [ | ||||
|         "3d", | ||||
|         "3ds", | ||||
|         "3mf", | ||||
|         "ac", | ||||
|         "ac3d", | ||||
|         "acc", | ||||
|         "amf", | ||||
|         "ase", | ||||
|         "ask", | ||||
|         "assbin", | ||||
|         "b3d", | ||||
|         "blend", | ||||
|         "bsp", | ||||
|         "bvh", | ||||
|         "cob", | ||||
|         "csm", | ||||
|         "dae", | ||||
|         "dxf", | ||||
|         "enff", | ||||
|         "fbx", | ||||
|         "glb", | ||||
|         "gltf", | ||||
|         "hmp", | ||||
|         "ifc", | ||||
|         "ifczip", | ||||
|         "iqm", | ||||
|         "irr", | ||||
|         "irrmesh", | ||||
|         "lwo", | ||||
|         "lws", | ||||
|         "lxo", | ||||
|         "md2", | ||||
|         "md3", | ||||
|         "md5anim", | ||||
|         "md5camera", | ||||
|         "md5mesh", | ||||
|         "mdc", | ||||
|         "mdl", | ||||
|         "mesh", | ||||
|         "mesh.xml", | ||||
|         "mot", | ||||
|         "ms3d", | ||||
|         "ndo", | ||||
|         "nff", | ||||
|         "obj", | ||||
|         "off", | ||||
|         "ogex", | ||||
|         "pk3", | ||||
|         "ply", | ||||
|         "pmx", | ||||
|         "prj", | ||||
|         "q3o", | ||||
|         "q3s", | ||||
|         "raw", | ||||
|         "scn", | ||||
|         "sib", | ||||
|         "smd", | ||||
|         "step", | ||||
|         "stl", | ||||
|         "stp", | ||||
|         "ter", | ||||
|         "uc", | ||||
|         "vta", | ||||
|         "x", | ||||
|         "x3d", | ||||
|         "x3db", | ||||
|         "xgl", | ||||
|         "xml", | ||||
|         "zae", | ||||
|         "zgl", | ||||
|     ], | ||||
|   }, | ||||
|   to: { | ||||
|     muxer: [ | ||||
|         "collada", | ||||
|         "x", | ||||
|         "stp", | ||||
|         "obj", | ||||
|         "objnomtl", | ||||
|         "stl", | ||||
|         "stlb", | ||||
|         "ply", | ||||
|         "plyb", | ||||
|         "3ds", | ||||
|         "gltf2", | ||||
|         "glb2", | ||||
|         "gltf", | ||||
|         "glb", | ||||
|         "assbin", | ||||
|         "assxml", | ||||
|         "x3d", | ||||
|         "fbx", | ||||
|         "fbxa", | ||||
|         "m3d", | ||||
|         "m3da", | ||||
|         "3mf", | ||||
|         "pbrt", | ||||
|         "assjson", | ||||
|     ], | ||||
|   }, | ||||
| }; | ||||
|  | ||||
| export async function convert( | ||||
|   filePath: string, | ||||
|   fileType: string, | ||||
|   convertTo: string, | ||||
|   targetPath: string, | ||||
|   // biome-ignore lint/suspicious/noExplicitAny: <explanation> | ||||
|   options?: any, | ||||
| ): Promise<string> { | ||||
|   // let command = "ffmpeg"; | ||||
|  | ||||
|  | ||||
|   const command = `assimp export "${filePath}" "${targetPath}"`; | ||||
|  | ||||
|   return new Promise((resolve, reject) => { | ||||
|     exec(command, (error, stdout, stderr) => { | ||||
|       if (error) { | ||||
|         reject(`error: ${error}`); | ||||
|       } | ||||
|  | ||||
|       if (stdout) { | ||||
|         console.log(`stdout: ${stdout}`); | ||||
|       } | ||||
|  | ||||
|       if (stderr) { | ||||
|         console.error(`stderr: ${stderr}`); | ||||
|       } | ||||
|  | ||||
|       resolve("success"); | ||||
|     }); | ||||
|   }); | ||||
| } | ||||
| @@ -143,6 +143,7 @@ export const properties = { | ||||
|       "svgz", | ||||
|       "text", | ||||
|       "tga", | ||||
|       "tif", | ||||
|       "tiff", | ||||
|       "tile", | ||||
|       "tim", | ||||
| @@ -227,7 +228,6 @@ export const properties = { | ||||
|       "jbig", | ||||
|       "jng", | ||||
|       "jpeg", | ||||
|       "jpg", | ||||
|       "k", | ||||
|       "m", | ||||
|       "m2v", | ||||
|   | ||||
| @@ -1,4 +1,7 @@ | ||||
| import { convert as convertImage, properties as propertiesImage } from "./vips"; | ||||
| import {  | ||||
|   convert as convertImage, | ||||
|   properties as propertiesImage | ||||
| } from "./vips"; | ||||
|  | ||||
| import { | ||||
|   convert as convertPandoc, | ||||
| @@ -30,6 +33,11 @@ import { | ||||
|   properties as propertiesresvg, | ||||
| } from "./resvg"; | ||||
|  | ||||
| import { | ||||
|   convert as convertassimp, | ||||
|   properties as propertiesassimp, | ||||
| } from "./assimp"; | ||||
|  | ||||
| import { normalizeFiletype } from "../helpers/normalizeFiletype"; | ||||
|  | ||||
| // This should probably be reconstructed so that the functions are not imported instead the functions hook into this to make the converters more modular | ||||
| @@ -78,6 +86,10 @@ const properties: Record<string, { | ||||
|     properties: propertiesGraphicsmagick, | ||||
|     converter: convertGraphicsmagick, | ||||
|   }, | ||||
|   assimp: { | ||||
|     properties: propertiesassimp, | ||||
|     converter: convertassimp, | ||||
|   }, | ||||
|   ffmpeg: { | ||||
|     properties: propertiesFFmpeg, | ||||
|     converter: convertFFmpeg, | ||||
|   | ||||
| @@ -83,6 +83,16 @@ if (process.env.NODE_ENV === "production") { | ||||
|     } | ||||
|   }); | ||||
|  | ||||
|   exec("assimp version", (error, stdout) => { | ||||
|     if (error) { | ||||
|       console.error("assimp is not installed"); | ||||
|     } | ||||
|  | ||||
|     if (stdout) { | ||||
|       console.log(`assimp v${stdout.split("\n")[5]}`); | ||||
|     } | ||||
|   }); | ||||
|  | ||||
|   exec("bun -v", (error, stdout) => { | ||||
|     if (error) { | ||||
|       console.error("Bun is not installed. wait what"); | ||||
|   | ||||
| @@ -565,7 +565,7 @@ const app = new Elysia({ | ||||
|                     {Object.entries(getAllTargets()).map( | ||||
|                       ([converter, targets]) => ( | ||||
|                         <article | ||||
|                           class="convert_to_group w-full border-b border-gray-700 p-4" | ||||
|                           class="convert_to_group w-full border-b border-gray-700 p-4 flex flex-col" | ||||
|                           data-converter={converter} | ||||
|                         > | ||||
|                           <header class="mb-2 w-full text-xl font-bold" safe> | ||||
| @@ -633,7 +633,7 @@ const app = new Elysia({ | ||||
|             {Object.entries(getPossibleTargets(body.fileType)).map( | ||||
|               ([converter, targets]) => ( | ||||
|                 <article | ||||
|                   class="convert_to_group w-full border-b border-gray-700 p-4" | ||||
|                   class="convert_to_group w-full border-b border-gray-700 p-4 flex flex-col" | ||||
|                   data-converter={converter} | ||||
|                 > | ||||
|                   <header class="mb-2 w-full text-xl font-bold" safe> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user