修正bug
parent
1c9a8da29e
commit
c528a2fcaf
22
src/app.js
22
src/app.js
|
|
@ -221,8 +221,8 @@ async function processSingle(item) {
|
|||
img = await getPdfPreview(item.file);
|
||||
item.originalImg = img;
|
||||
originalInfo.innerHTML = `
|
||||
<p>Type: PDF (NotebookLM)</p>
|
||||
<p>${i18n.t('info.size')}: ${(item.file.size / 1024 / 1024).toFixed(2)} MB</p>
|
||||
<div>Type: PDF (NotebookLM)</div>
|
||||
<div>${i18n.t('info.size')}: ${(item.file.size / 1024 / 1024).toFixed(2)} MB</div>
|
||||
`;
|
||||
setStatusMessage('NotebookLM PDF Detected', 'success');
|
||||
} else {
|
||||
|
|
@ -235,9 +235,9 @@ async function processSingle(item) {
|
|||
|
||||
const watermarkInfo = engine.getWatermarkInfo(img.width, img.height);
|
||||
originalInfo.innerHTML = `
|
||||
<p>${i18n.t('info.size')}: ${img.width}×${img.height}</p>
|
||||
<p>${i18n.t('info.watermark')}: ${watermarkInfo.width}×${watermarkInfo.height}</p>
|
||||
<p>${i18n.t('info.position')}: (${watermarkInfo.position.x},${watermarkInfo.position.y})</p>
|
||||
<div>${i18n.t('info.size')}: ${img.width}×${img.height}</div>
|
||||
<div>${i18n.t('info.watermark')}: ${watermarkInfo.width}×${watermarkInfo.height}</div>
|
||||
<div>${i18n.t('info.position')}: (${watermarkInfo.position.x},${watermarkInfo.position.y})</div>
|
||||
`;
|
||||
}
|
||||
|
||||
|
|
@ -279,13 +279,13 @@ async function processSingle(item) {
|
|||
|
||||
if (item.isPdf) {
|
||||
processedInfo.innerHTML = `
|
||||
<p>${i18n.t('info.status')}: ${i18n.t('info.removed')}</p>
|
||||
<p>Output: PDF</p>
|
||||
<div>${i18n.t('info.status')}: ${i18n.t('info.removed')}</div>
|
||||
<div>Output: PDF</div>
|
||||
`;
|
||||
} else {
|
||||
processedInfo.innerHTML = `
|
||||
<p>${i18n.t('info.size')}: ${img.width}×${img.height}</p>
|
||||
<p>${i18n.t('info.status')}: ${i18n.t('info.removed')}</p>
|
||||
<div>${i18n.t('info.size')}: ${img.width}×${img.height}</div>
|
||||
<div>${i18n.t('info.status')}: ${i18n.t('info.removed')}</div>
|
||||
`;
|
||||
}
|
||||
|
||||
|
|
@ -459,7 +459,7 @@ async function processPdf(file, onProgress) {
|
|||
for (let i = 1; i <= total; i++) {
|
||||
if (onProgress) onProgress(i, total);
|
||||
const page = await pdf.getPage(i);
|
||||
const viewport = page.getViewport({ scale: 2 });
|
||||
const viewport = page.getViewport({ scale: 3 });
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
canvas.width = viewport.width;
|
||||
|
|
@ -488,7 +488,7 @@ async function processPdf(file, onProgress) {
|
|||
|
||||
const cleanedCanvas = await engine.removeWatermarkFromImage(canvas, { forceSimpleClone: true });
|
||||
|
||||
const imgData = cleanedCanvas.toDataURL('image/jpeg', 0.9);
|
||||
const imgData = cleanedCanvas.toDataURL('image/jpeg', 0.95);
|
||||
|
||||
// Capture first page as preview
|
||||
if (i === 1) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue