MCPcopy Create free account
hub / github.com/32comic/image2pixel-web / processImage

Method processImage

pixelizer.js:493–517  ·  view source on GitHub ↗

* 处理图片

()

Source from the content-addressed store, hash-verified

491 * 处理图片
492 */
493 async processImage() {
494 if (!this.originalImage || this.isProcessing) return;
495
496 try {
497 this.isProcessing = true;
498 this.showProgress(0, '开始处理...');
499
500 const mode = document.querySelector('input[name="detectionMode"]:checked').value;
501
502 if (mode === 'auto') {
503 await this.processAutoMode();
504 } else {
505 await this.processManualMode();
506 }
507
508 this.showPreview();
509 this.hideProgress();
510
511 } catch (error) {
512 console.error('Processing failed:', error);
513 this.showError('处理失败: ' + error.message);
514 } finally {
515 this.isProcessing = false;
516 }
517 }
518
519 async processAutoMode() {
520 this.showProgress(20, '分析像素块结构...');

Callers 2

loadImageMethod · 0.95
updatePreviewIfNeededMethod · 0.95

Calls 6

showProgressMethod · 0.95
processAutoModeMethod · 0.95
processManualModeMethod · 0.95
showPreviewMethod · 0.95
hideProgressMethod · 0.95
showErrorMethod · 0.95

Tested by

no test coverage detected