Przeglądaj źródła

chore: 替换预览图格式为webp并更新相关配置

1. 删除旧的png格式预览图文件
2. 更新.gitignore忽略新增的webp预览图文件
3. 修改App.vue和TerrainViewer.vue中的纹理图片引用路径
4. 更新预览图生成脚本,将输出格式改为webp
5. 更新dist/index.html中的资源哈希引用
wenhongquan 1 miesiąc temu
rodzic
commit
601a6d4a54

+ 2 - 0
.gitignore

@@ -20,3 +20,5 @@ docs/
 # should NOT be excluded as they contain compiler settings and other important
 # information for Eclipse / Flash Builder.
 de99928f1689454084d1af33ec3cc155.tif
+de99928f-preview.webp
+public/de99928f-preview.webp

Plik diff jest za duży
+ 0 - 0
dist/assets/index-CSsNmMlT.js


Plik diff jest za duży
+ 0 - 0
dist/assets/index-Ci-fmrzT.css


+ 2 - 2
dist/index.html

@@ -7,8 +7,8 @@
     <meta charset="UTF-8" />
     <meta name="viewport" content="width=device-width, initial-scale=1.0" />
     <title>3D 大屏 - 倾斜摄影</title>
-    <script type="module" crossorigin src="/assets/index-tOdE2X96.js"></script>
-    <link rel="stylesheet" crossorigin href="/assets/index-Co3HZtGW.css">
+    <script type="module" crossorigin src="/assets/index-CSsNmMlT.js"></script>
+    <link rel="stylesheet" crossorigin href="/assets/index-Ci-fmrzT.css">
   </head>
   <body>
     <div id="app"></div>

BIN
public/de99928f-preview.png


+ 2 - 2
scripts/gen-preview.cjs

@@ -5,7 +5,7 @@ const path = require('path')
 
 async function main() {
   const tiffPath = path.resolve(__dirname, '../de99928f1689454084d1af33ec3cc155.tif')
-  const outPath = path.resolve(__dirname, '../public/de99928f-preview.png')
+  const outPath = path.resolve(__dirname, '../public/de99928f-preview.webp')
 
   if (!fs.existsSync(tiffPath)) {
     console.error('TIFF not found:', tiffPath)
@@ -46,7 +46,7 @@ async function main() {
   console.log('Black pixels masked:', blackCount)
 
   await sharp(rgba, { raw: { width: targetW, height: targetH, channels: 4 } })
-    .png({ compressionLevel: 9, adaptiveFiltering: true })
+    .webp({ quality: 85, alphaQuality: 100, effort: 6 })
     .toFile(outPath)
 
   console.log('Saved:', outPath)

+ 1 - 1
src/App.vue

@@ -186,7 +186,7 @@ function onMarkerClick(marker) {
       @update:markers="onMarkerUpdate"
       @markerClick="onMarkerClick"
       meta-url="https://ossdsh.device.wenhq.top:8583/crj/terrain-meta.json"
-      texture-url="/de99928f-preview.png"
+      texture-url="/de99928f-preview.webp"
       elevation-url="https://ossdsh.device.wenhq.top:8583/crj/terrain-elevations.bin"
       :vertical-exaggeration="2"
       :camera-distance="0.74"

+ 1 - 1
src/components/TerrainViewer.vue

@@ -6,7 +6,7 @@ import { config } from '../config'
 
 const props = defineProps({
   metaUrl: { type: String, default: '/terrain-meta.json' },
-  textureUrl: { type: String, default: '/de99928f-preview.jpg' },
+  textureUrl: { type: String, default: '/de99928f-preview.webp' },
   elevationUrl: { type: String, default: '/terrain-elevations.bin' },
   verticalExaggeration: { type: Number, default: 1.5 },
   cameraDistance: { type: Number, default: 1 },

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików