mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-14 12:38:50 +02:00
fix(chapter): fix chapter conversion.
Still need to figure out the memory issues Consolidates image conversion logic into a dedicated method. This change streamlines the conversion process by centralizing the setting of converted image data, extension, and size. It also introduces a flag to track whether an image has been converted. The old resource cleanup has been removed since it is not needed anymore.
This commit is contained in:
@@ -80,7 +80,6 @@ func (converter *Converter) ConvertChapter(chapter *manga.Chapter, quality uint8
|
||||
go func(pageToConvert *manga.PageContainer) {
|
||||
defer func() {
|
||||
wgConvertedPages.Done()
|
||||
pageToConvert.Close() // Clean up resources
|
||||
<-guard
|
||||
}()
|
||||
|
||||
@@ -243,9 +242,7 @@ func (converter *Converter) convertPage(container *manga.PageContainer, quality
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
container.Page.Contents = converted
|
||||
container.Page.Extension = ".webp"
|
||||
container.Page.Size = uint64(converted.Len())
|
||||
container.SetConverted(converted, ".webp");
|
||||
return container, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user