mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2024-11-11 02:10:11 +01:00
Fix: introduces the verification of the python installation (#1730)
* Fix: introduces the verification of the python installation * Update ExtractImageScansController.java * Update CheckProgramInstall.java
This commit is contained in:
parent
9f0088c839
commit
1a594b27ab
@ -7,7 +7,6 @@ import java.net.URLConnection;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.zip.ZipEntry;
|
||||
@ -17,7 +16,6 @@ import org.apache.commons.io.FileUtils;
|
||||
import org.apache.pdfbox.rendering.ImageType;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.MediaType;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
@ -32,6 +30,7 @@ import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
import stirling.software.SPDF.model.api.converters.ConvertToImageRequest;
|
||||
import stirling.software.SPDF.model.api.converters.ConvertToPdfRequest;
|
||||
import stirling.software.SPDF.utils.CheckProgramInstall;
|
||||
import stirling.software.SPDF.utils.PdfUtils;
|
||||
import stirling.software.SPDF.utils.ProcessExecutor;
|
||||
import stirling.software.SPDF.utils.ProcessExecutor.ProcessExecutorResult;
|
||||
@ -82,7 +81,10 @@ public class ConvertImgPDFController {
|
||||
if (result == null || result.length == 0) {
|
||||
logger.error("resultant bytes for {} is null, error converting ", filename);
|
||||
}
|
||||
if (imageFormat.equalsIgnoreCase("webp")) {
|
||||
if (imageFormat.equalsIgnoreCase("webp") && !CheckProgramInstall.isPythonAvailable()) {
|
||||
throw new IOException("Python is not installed. Required for WebP conversion.");
|
||||
} else if (imageFormat.equalsIgnoreCase("webp")
|
||||
&& CheckProgramInstall.isPythonAvailable()) {
|
||||
// Write the output stream to a temp file
|
||||
Path tempFile = Files.createTempFile("temp_png", ".png");
|
||||
try (FileOutputStream fos = new FileOutputStream(tempFile.toFile())) {
|
||||
@ -90,21 +92,13 @@ public class ConvertImgPDFController {
|
||||
fos.flush();
|
||||
}
|
||||
|
||||
String pythonVersion = "python3";
|
||||
try {
|
||||
ProcessExecutor.getInstance(ProcessExecutor.Processes.PYTHON_OPENCV)
|
||||
.runCommandWithOutputHandling(Arrays.asList("python3", "--version"));
|
||||
} catch (IOException e) {
|
||||
ProcessExecutor.getInstance(ProcessExecutor.Processes.PYTHON_OPENCV)
|
||||
.runCommandWithOutputHandling(Arrays.asList("python", "--version"));
|
||||
pythonVersion = "python";
|
||||
}
|
||||
String pythonVersion = CheckProgramInstall.getAvailablePythonCommand();
|
||||
|
||||
List<String> command = new ArrayList<>();
|
||||
command.add(pythonVersion);
|
||||
command.add("./scripts/png_to_webp.py"); // Python script to handle the conversion
|
||||
|
||||
// Create a temporary directory for the output WebP files
|
||||
// Create a temporary directory for the output WebP files
|
||||
Path tempOutputDir = Files.createTempDirectory("webp_output");
|
||||
if (singleImage) {
|
||||
// Run the Python script to convert PNG to WebP
|
||||
|
@ -32,6 +32,7 @@ import io.swagger.v3.oas.annotations.parameters.RequestBody;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
import stirling.software.SPDF.model.api.misc.ExtractImageScansRequest;
|
||||
import stirling.software.SPDF.utils.CheckProgramInstall;
|
||||
import stirling.software.SPDF.utils.ProcessExecutor;
|
||||
import stirling.software.SPDF.utils.ProcessExecutor.ProcessExecutorResult;
|
||||
import stirling.software.SPDF.utils.WebResponseUtils;
|
||||
@ -76,6 +77,11 @@ public class ExtractImageScansController {
|
||||
Path tempZipFile = null;
|
||||
List<Path> tempDirs = new ArrayList<>();
|
||||
|
||||
if (!CheckProgramInstall.isPythonAvailable()) {
|
||||
throw new IOException("Python is not installed.");
|
||||
}
|
||||
|
||||
String pythonVersion = CheckProgramInstall.getAvailablePythonCommand();
|
||||
try {
|
||||
// Check if input file is a PDF
|
||||
if ("pdf".equalsIgnoreCase(extension)) {
|
||||
@ -117,7 +123,7 @@ public class ExtractImageScansController {
|
||||
List<String> command =
|
||||
new ArrayList<>(
|
||||
Arrays.asList(
|
||||
"python3",
|
||||
pythonVersion,
|
||||
"./scripts/split_photos.py",
|
||||
images.get(i),
|
||||
tempDir.toString(),
|
||||
|
@ -140,9 +140,9 @@ public class ExtractImagesController {
|
||||
Set<Integer> processedImages,
|
||||
ZipOutputStream zos)
|
||||
throws IOException {
|
||||
if(page.getResources() == null || page.getResources().getXObjectNames() == null) {
|
||||
return;
|
||||
}
|
||||
if (page.getResources() == null || page.getResources().getXObjectNames() == null) {
|
||||
return;
|
||||
}
|
||||
for (COSName name : page.getResources().getXObjectNames()) {
|
||||
if (page.getResources().isImageXObject(name)) {
|
||||
PDImageXObject image = (PDImageXObject) page.getResources().getXObject(name);
|
||||
|
@ -9,6 +9,8 @@ import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
import stirling.software.SPDF.utils.CheckProgramInstall;
|
||||
|
||||
@Controller
|
||||
@Tag(name = "Convert", description = "Convert APIs")
|
||||
public class ConverterWebController {
|
||||
@ -69,6 +71,8 @@ public class ConverterWebController {
|
||||
@GetMapping("/pdf-to-img")
|
||||
@Hidden
|
||||
public String pdfToimgForm(Model model) {
|
||||
boolean isPython = CheckProgramInstall.isPythonAvailable();
|
||||
model.addAttribute("isPython", isPython);
|
||||
model.addAttribute("currentPage", "pdf-to-img");
|
||||
return "convert/pdf-to-img";
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ import io.swagger.v3.oas.annotations.Hidden;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
||||
import stirling.software.SPDF.model.ApplicationProperties;
|
||||
import stirling.software.SPDF.utils.CheckProgramInstall;
|
||||
|
||||
@Controller
|
||||
@Tag(name = "Misc", description = "Miscellaneous APIs")
|
||||
@ -34,6 +35,8 @@ public class OtherWebController {
|
||||
@Hidden
|
||||
public ModelAndView extractImageScansForm() {
|
||||
ModelAndView modelAndView = new ModelAndView("misc/extract-image-scans");
|
||||
boolean isPython = CheckProgramInstall.isPythonAvailable();
|
||||
modelAndView.addObject("isPython", isPython);
|
||||
modelAndView.addObject("currentPage", "extract-image-scans");
|
||||
return modelAndView;
|
||||
}
|
||||
|
@ -0,0 +1,59 @@
|
||||
package stirling.software.SPDF.utils;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import stirling.software.SPDF.utils.ProcessExecutor.ProcessExecutorResult;
|
||||
|
||||
public class CheckProgramInstall {
|
||||
|
||||
private static final List<String> PYTHON_COMMANDS = Arrays.asList("python3", "python");
|
||||
private static boolean pythonAvailableChecked = false;
|
||||
private static String availablePythonCommand = null;
|
||||
|
||||
/**
|
||||
* Checks which Python command is available and returns it.
|
||||
*
|
||||
* @return The available Python command ("python3" or "python"), or null if neither is
|
||||
* available.
|
||||
*/
|
||||
public static String getAvailablePythonCommand() {
|
||||
if (!pythonAvailableChecked) {
|
||||
availablePythonCommand =
|
||||
PYTHON_COMMANDS.stream()
|
||||
.filter(CheckProgramInstall::checkPythonVersion)
|
||||
.findFirst()
|
||||
.orElse(null);
|
||||
pythonAvailableChecked = true;
|
||||
}
|
||||
return availablePythonCommand;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the specified command is available by running the command with --version.
|
||||
*
|
||||
* @param pythonCommand The Python command to check.
|
||||
* @return true if the command is available, false otherwise.
|
||||
*/
|
||||
private static boolean checkPythonVersion(String pythonCommand) {
|
||||
try {
|
||||
ProcessExecutorResult result =
|
||||
ProcessExecutor.getInstance(ProcessExecutor.Processes.PYTHON_OPENCV)
|
||||
.runCommandWithOutputHandling(
|
||||
Arrays.asList(pythonCommand, "--version"));
|
||||
return true; // Command succeeded, Python is available
|
||||
} catch (IOException | InterruptedException e) {
|
||||
return false; // Command failed, Python is not available
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if any Python command is available.
|
||||
*
|
||||
* @return true if any Python command is available, false otherwise.
|
||||
*/
|
||||
public static boolean isPythonAvailable() {
|
||||
return getAvailablePythonCommand() != null;
|
||||
}
|
||||
}
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=الحد الأدنى لمنطقة المحيط:
|
||||
ScannerImageSplit.selectText.8=تعيين الحد الأدنى لمنطقة المحيط للصورة
|
||||
ScannerImageSplit.selectText.9=حجم الحدود:
|
||||
ScannerImageSplit.selectText.10=يضبط حجم الحدود المضافة والمزالة لمنع الحدود البيضاء في الإخراج (الافتراضي: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=اللون
|
||||
pdfToImage.grey=تدرج الرمادي
|
||||
pdfToImage.blackwhite=أبيض وأسود (قد يفقد البيانات!)
|
||||
pdfToImage.submit=تحول
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Минимална контурна площ:
|
||||
ScannerImageSplit.selectText.8=Задава минималния праг на контурната площ за изображение
|
||||
ScannerImageSplit.selectText.9=Размер на рамката:
|
||||
ScannerImageSplit.selectText.10=Задава размера на добавената и премахната граница, за да предотврати бели граници към изхода (по подразбиране: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Цвят
|
||||
pdfToImage.grey=Скала на сивото
|
||||
pdfToImage.blackwhite=Черно и бяло (може да загубите данни!)
|
||||
pdfToImage.submit=Преобразуване
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Àrea de contorn mínima:
|
||||
ScannerImageSplit.selectText.8=Estableix el llindar mínim de l'àrea de contorn per a una foto
|
||||
ScannerImageSplit.selectText.9=Mida Vora:
|
||||
ScannerImageSplit.selectText.10=Estableix la mida de la vora afegida i eliminada per evitar vores blanques a la sortida (per defecte: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Color
|
||||
pdfToImage.grey=Escala de Grisos
|
||||
pdfToImage.blackwhite=Blanc i Negre (Pot perdre dades!)
|
||||
pdfToImage.submit=Converteix
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimální plocha kontury:
|
||||
ScannerImageSplit.selectText.8=Nastaví minimální plošný práh kontury pro fotografii
|
||||
ScannerImageSplit.selectText.9=Velikost okraje:
|
||||
ScannerImageSplit.selectText.10=Nastaví velikost okraje přidaného a odebraného k zabránění bílých ohraničení ve výstupu (výchozí: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Barevný
|
||||
pdfToImage.grey=Stupně šedi
|
||||
pdfToImage.blackwhite=Černobílý (Může dojít k ztrátě dat!)
|
||||
pdfToImage.submit=Převést
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimum Contour Area:
|
||||
ScannerImageSplit.selectText.8=Sets the minimum contour area threshold for a photo
|
||||
ScannerImageSplit.selectText.9=Border Size:
|
||||
ScannerImageSplit.selectText.10=Sets the size of the border added and removed to prevent white borders in the output (default: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Colour
|
||||
pdfToImage.grey=Greyscale
|
||||
pdfToImage.blackwhite=Black and White (May lose data!)
|
||||
pdfToImage.submit=Convert
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimaler Konturbereich:
|
||||
ScannerImageSplit.selectText.8=Legt den minimalen Konturbereichsschwellenwert für ein Foto fest
|
||||
ScannerImageSplit.selectText.9=Randgröße:
|
||||
ScannerImageSplit.selectText.10=Legt die Größe des hinzugefügten und entfernten Randes fest, um weiße Ränder in der Ausgabe zu verhindern (Standard: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Farbe
|
||||
pdfToImage.grey=Graustufen
|
||||
pdfToImage.blackwhite=Schwarzweiß (Datenverlust möglich!)
|
||||
pdfToImage.submit=Umwandeln
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Ελάχιστη επιφάνεια περιγρ
|
||||
ScannerImageSplit.selectText.8=Ρυθμίζει το ελάχιστο όριο περιγράμματος για μια φωτογραφία
|
||||
ScannerImageSplit.selectText.9=Μέγεθος περιγράμματος:
|
||||
ScannerImageSplit.selectText.10=Ορίζει το μέγεθος του περιγράμματος που προστίθεται και αφαιρείται για να αποτρέπονται λευκά περιγράμματα στην έξοδο (προεπιλογή: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Χρώμα
|
||||
pdfToImage.grey=Κλίμακα του γκρι
|
||||
pdfToImage.blackwhite=Ασπρόμαυρο (Μπορεί να χαθούν δεδομένα!)
|
||||
pdfToImage.submit=Μετατροπή
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimum Contour Area:
|
||||
ScannerImageSplit.selectText.8=Sets the minimum contour area threshold for a photo
|
||||
ScannerImageSplit.selectText.9=Border Size:
|
||||
ScannerImageSplit.selectText.10=Sets the size of the border added and removed to prevent white borders in the output (default: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Colour
|
||||
pdfToImage.grey=Greyscale
|
||||
pdfToImage.blackwhite=Black and White (May lose data!)
|
||||
pdfToImage.submit=Convert
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimum Contour Area:
|
||||
ScannerImageSplit.selectText.8=Sets the minimum contour area threshold for a photo
|
||||
ScannerImageSplit.selectText.9=Border Size:
|
||||
ScannerImageSplit.selectText.10=Sets the size of the border added and removed to prevent white borders in the output (default: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Color
|
||||
pdfToImage.grey=Grayscale
|
||||
pdfToImage.blackwhite=Black and White (May lose data!)
|
||||
pdfToImage.submit=Convert
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Área mínima de contorno:
|
||||
ScannerImageSplit.selectText.8=Establecer el umbral mínimo del área de contorno para una foto
|
||||
ScannerImageSplit.selectText.9=Tamaño del borde:
|
||||
ScannerImageSplit.selectText.10=Establece el tamaño del borde agregado y eliminado para evitar bordes blancos en la salida (predeterminado: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Color
|
||||
pdfToImage.grey=Escala de grises
|
||||
pdfToImage.blackwhite=Blanco y Negro (¡Puede perder datos!)
|
||||
pdfToImage.submit=Convertir
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Inguruko area gutxienekoa:
|
||||
ScannerImageSplit.selectText.8=Ezarri inguruko arearen gutxieneko balioa argazki batentzat
|
||||
ScannerImageSplit.selectText.9=Ertzaren tamaina:
|
||||
ScannerImageSplit.selectText.10=Ezarri gehitutako eta ezabatutako ertzaren tamaina irteeran ertz zuriak saihesteko (lehenetsia: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Kolorea
|
||||
pdfToImage.grey=Gris-eskala
|
||||
pdfToImage.blackwhite=Zuria eta Beltza (Datuak galdu ditzake!)
|
||||
pdfToImage.submit=Bihurtu
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Surface de contour minimale
|
||||
ScannerImageSplit.selectText.8=Définit la surface de contour minimale pour une photo (par défaut : 500).
|
||||
ScannerImageSplit.selectText.9=Taille de la bordure
|
||||
ScannerImageSplit.selectText.10=Définit la taille de la bordure ajoutée et supprimée pour éviter les bordures blanches dans la sortie (par défaut : 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Couleur
|
||||
pdfToImage.grey=Niveaux de gris
|
||||
pdfToImage.blackwhite=Noir et blanc (peut engendrer une perte de données !)
|
||||
pdfToImage.submit=Convertir
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Íos-Limistéar Comhrianta:
|
||||
ScannerImageSplit.selectText.8=Socraíonn sé an tairseach íosta achar comhrianta le haghaidh grianghraf
|
||||
ScannerImageSplit.selectText.9=Méid na Teorann:
|
||||
ScannerImageSplit.selectText.10=Socraíonn sé méid na teorann a chuirtear leis agus a bhaintear chun teorainneacha bán a chosc san aschur (réamhshocraithe: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Dath
|
||||
pdfToImage.grey=Scála Liath
|
||||
pdfToImage.blackwhite=Dubh agus Bán (D’fhéadfadh sonraí a chailleadh!)
|
||||
pdfToImage.submit=Tiontaigh
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=न्यूनतम कंटोर क्ष
|
||||
ScannerImageSplit.selectText.8=फोटो के लिए न्यूनतम कंटोर क्षेत्र थ्रेशोल्ड को सेट करता है।
|
||||
ScannerImageSplit.selectText.9=बॉर्डर का आकार:
|
||||
ScannerImageSplit.selectText.10=निकालने और जोड़ने के लिए जोड़ा जाने वाला बॉर्डर का आकार सेट करता है ताकि आउटपुट में सफेद बॉर्डर न आए (डिफ़ॉल्ट: 1)।
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=रंगीन
|
||||
pdfToImage.grey=ग्रे स्केल
|
||||
pdfToImage.blackwhite=काला और सफेद (डेटा खो सकता है!)
|
||||
pdfToImage.submit=परिवर्तित करें
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimalna konturna površina:
|
||||
ScannerImageSplit.selectText.8=Postavlja minimalni prag površine konture za fotografiju
|
||||
ScannerImageSplit.selectText.9=Veličina obruba:
|
||||
ScannerImageSplit.selectText.10=Postavlja veličinu obruba koji se dodaje i uklanja kako bi se spriječili bijeli obrubi u ispisu (zadano: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Boja
|
||||
pdfToImage.grey=Sivi tonovi
|
||||
pdfToImage.blackwhite=Crno-bijelo (mogu se izgubiti podaci!)
|
||||
pdfToImage.submit=Pretvori
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimális kontúr terület:
|
||||
ScannerImageSplit.selectText.8=A fotók minimális kontúrterületének beállítása
|
||||
ScannerImageSplit.selectText.9=Keret mérete:
|
||||
ScannerImageSplit.selectText.10=A hozzáadott és eltávolított keret méretének beállítása a fehér keretek elkerülése érdekében a kimeneten (alapértelmezett: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=színes
|
||||
pdfToImage.grey=szürkeárnyalatos
|
||||
pdfToImage.blackwhite=fekete-fehér (adatvesztéssel járhat!)
|
||||
pdfToImage.submit=Átalakítás
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Area Kontur Minimum:
|
||||
ScannerImageSplit.selectText.8=Menetapkan ambang batas area kontur minimum untuk foto
|
||||
ScannerImageSplit.selectText.9=Ukuran Batas:
|
||||
ScannerImageSplit.selectText.10=Menetapkan ukuran batas yang ditambahkan dan dihapus untuk mencegah batas putih pada output (default: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Warna
|
||||
pdfToImage.grey=Skala abu-abu
|
||||
pdfToImage.blackwhite=Black and White (Bisa kehilangan data!)
|
||||
pdfToImage.submit=Konversi
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Area di contorno minima:
|
||||
ScannerImageSplit.selectText.8=Imposta l'area minima del contorno di una foto
|
||||
ScannerImageSplit.selectText.9=Spessore bordo:
|
||||
ScannerImageSplit.selectText.10=Imposta lo spessore del bordo aggiunto o rimosso per prevenire bordi bianchi nel risultato (predefinito: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=A colori
|
||||
pdfToImage.grey=Scala di grigi
|
||||
pdfToImage.blackwhite=Bianco e Nero (potresti perdere dettagli!)
|
||||
pdfToImage.submit=Converti
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=最小輪郭面積:
|
||||
ScannerImageSplit.selectText.8=画像の最小の輪郭面積のしきい値を設定。
|
||||
ScannerImageSplit.selectText.9=境界線サイズ:
|
||||
ScannerImageSplit.selectText.10=出力に白い縁取りが出ないように追加・削除される境界線の大きさを設定 (初期値:1)。
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=カラー
|
||||
pdfToImage.grey=グレースケール
|
||||
pdfToImage.blackwhite=白黒 (データが失われる可能性があります!)
|
||||
pdfToImage.submit=変換
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=최소 윤곽 영역:
|
||||
ScannerImageSplit.selectText.8=사진의 최소 윤곽선 영역 임계값을 설정합니다.
|
||||
ScannerImageSplit.selectText.9=테두리 크기:
|
||||
ScannerImageSplit.selectText.10=출력에서 흰색 테두리를 방지하기 위해 추가 및 제거되는 테두리의 크기를 설정합니다(기본값: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=컬러
|
||||
pdfToImage.grey=그레이스케일
|
||||
pdfToImage.blackwhite=흑백 (데이터 손실 가능성 있음!)
|
||||
pdfToImage.submit=변환
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimum contour oppervlakte:
|
||||
ScannerImageSplit.selectText.8=Stelt de minimale contour oppervlakte drempel in voor een foto
|
||||
ScannerImageSplit.selectText.9=Randgrootte:
|
||||
ScannerImageSplit.selectText.10=Stelt de grootte van de toegevoegde en verwijderde rand in om witte randen in de uitvoer te voorkomen (standaard: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Kleur
|
||||
pdfToImage.grey=Grijstinten
|
||||
pdfToImage.blackwhite=Zwart en wit (kan data verliezen!)
|
||||
pdfToImage.submit=Omzetten
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimumskonturområde:
|
||||
ScannerImageSplit.selectText.8=Angir minimumskonturområde terskel for et bilde
|
||||
ScannerImageSplit.selectText.9=Kantstørrelse:
|
||||
ScannerImageSplit.selectText.10=Angir størrelsen på kanten som legges til og fjernes for å forhindre hvite kanter i utdataen (standard: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Farge
|
||||
pdfToImage.grey=Gråtone
|
||||
pdfToImage.blackwhite=Svart-hvitt (kan miste data!)
|
||||
pdfToImage.submit=Konverter
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimalny obszar konturu:
|
||||
ScannerImageSplit.selectText.8=Ustawia próg minimalnego obszaru konturu dla zdjęcia
|
||||
ScannerImageSplit.selectText.9=Rozmiar obramowania:
|
||||
ScannerImageSplit.selectText.10=Ustawia rozmiar dodawanego i usuwanego obramowania, aby uniknąć białych obramowań na wyjściu (domyślnie: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Kolor
|
||||
pdfToImage.grey=Odcień szarości
|
||||
pdfToImage.blackwhite=Czarno-biały (może spowodować utratę danych!)
|
||||
pdfToImage.submit=Konwertuj
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Área mínima de contorno:
|
||||
ScannerImageSplit.selectText.8=Define o limite mínimo da área de contorno para uma foto
|
||||
ScannerImageSplit.selectText.9=Tamanho da borda:
|
||||
ScannerImageSplit.selectText.10=Define o tamanho da borda adicionada e removida para evitar bordas brancas na saída (padrão: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Colorida
|
||||
pdfToImage.grey=Escala de Cinza
|
||||
pdfToImage.blackwhite=Preto e Branco (pode perder de dados!)
|
||||
pdfToImage.submit=Converter
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Área mínima de contorno:
|
||||
ScannerImageSplit.selectText.8=Define o limite mínimo da área de contorno para uma foto
|
||||
ScannerImageSplit.selectText.9=Tamanho do contorno:
|
||||
ScannerImageSplit.selectText.10=Define o tamanho do contorno adicionado e removido para evitar contornos brancos na saída (padrão: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Colorida
|
||||
pdfToImage.grey=Escala de Cinza
|
||||
pdfToImage.blackwhite=Preto e Branco (pode resultar em perda de dados!)
|
||||
pdfToImage.submit=Converter
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Arie minimă a conturului:
|
||||
ScannerImageSplit.selectText.8=Stabilește pragul minim de arie a conturului pentru o fotografie.
|
||||
ScannerImageSplit.selectText.9=Mărimea marginii:
|
||||
ScannerImageSplit.selectText.10=Stabilește mărimea marginii adăugate și eliminate pentru a evita marginile albe în rezultat (implicit: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Culoare
|
||||
pdfToImage.grey=Scală de gri
|
||||
pdfToImage.blackwhite=Alb și negru (Poate pierde date!)
|
||||
pdfToImage.submit=Convertă
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Минимальная площадь конту
|
||||
ScannerImageSplit.selectText.8=Устанавливает минимальный порог области контура для фотографии
|
||||
ScannerImageSplit.selectText.9=Размер границы:
|
||||
ScannerImageSplit.selectText.10=Устанавливает размер добавляемой и удаляемой границы, чтобы предотвратить появление белых границ на выходе (по умолчанию: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Цвет
|
||||
pdfToImage.grey=Оттенки серого
|
||||
pdfToImage.blackwhite=Черно-белый (может потерять данные!)
|
||||
pdfToImage.submit=Конвертировать
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimálna plocha obrysu:
|
||||
ScannerImageSplit.selectText.8=Nastaví minimálnu prahovú hodnotu plochy obrysu pre fotografiu
|
||||
ScannerImageSplit.selectText.9=Veľkosť okraja:
|
||||
ScannerImageSplit.selectText.10=Nastaví veľkosť okraja pridaného a odstráneného, aby sa zabránilo bielym okrajom vo výstupe (predvolené: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Farba
|
||||
pdfToImage.grey=Odtiene šedej
|
||||
pdfToImage.blackwhite=Čierno-biele (Môže stratiť údaje!)
|
||||
pdfToImage.submit=Konvertovať
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimalna površina konture:
|
||||
ScannerImageSplit.selectText.8=Postavlja minimalni prag površine konture za fotografiju
|
||||
ScannerImageSplit.selectText.9=Veličina ivice:
|
||||
ScannerImageSplit.selectText.10=Postavlja veličinu ivice dodate i uklonjene kako bi se sprečile bele ivice u izlazu (podrazumevano: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Boja
|
||||
pdfToImage.grey=Nijanse sive
|
||||
pdfToImage.blackwhite=Crno-belo (Može izgubiti podatke!)
|
||||
pdfToImage.submit=Konvertuj
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minsta konturarea:
|
||||
ScannerImageSplit.selectText.8=Ställer in minsta tröskelvärde för konturarea för ett foto
|
||||
ScannerImageSplit.selectText.9=Kantstorlek:
|
||||
ScannerImageSplit.selectText.10=Ställer in storleken på kanten som läggs till och tas bort för att förhindra vita kanter i utdata (standard: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Färg
|
||||
pdfToImage.grey=Gråskala
|
||||
pdfToImage.blackwhite=Svartvitt (kan förlora data!)
|
||||
pdfToImage.submit=Konvertera
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=พื้นที่เค้าโครงข
|
||||
ScannerImageSplit.selectText.8=ตั้งค่าเกณฑ์พื้นที่เค้าโครงขั้นต่ำสำหรับรูปภาพ
|
||||
ScannerImageSplit.selectText.9=ขนาดขอบ:
|
||||
ScannerImageSplit.selectText.10=ตั้งค่าขนาดขอบที่เพิ่มและลบเพื่อป้องกันขอบขาวในผลลัพธ์ (ค่าเริ่มต้น: 1)
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=สี
|
||||
pdfToImage.grey=ระดับสีเทา
|
||||
pdfToImage.blackwhite=ขาวดำ (อาจสูญเสียข้อมูล!)
|
||||
pdfToImage.submit=แปลง
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Minimum Kontur Alanı:
|
||||
ScannerImageSplit.selectText.8=Bir fotoğraf için minimum kontur alanı eşiğini ayarlar
|
||||
ScannerImageSplit.selectText.9=Kenar Boyutu:
|
||||
ScannerImageSplit.selectText.10=Çıktıda beyaz kenarların önlenmesi için eklenen ve kaldırılan kenarın boyutunu ayarlar (varsayılan: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Renk
|
||||
pdfToImage.grey=Gri tonlama
|
||||
pdfToImage.blackwhite=Siyah ve Beyaz (Veri kaybolabilir!)
|
||||
pdfToImage.submit=Dönüştür
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Мінімальна площа контуру:
|
||||
ScannerImageSplit.selectText.8=Встановлює мінімальний поріг площі контуру для фотографії
|
||||
ScannerImageSplit.selectText.9=Розмір рамки:
|
||||
ScannerImageSplit.selectText.10=Встановлює розмір додаваної та видаляної рамки, щоб запобігти появі білих рамок на виході (за замовчуванням: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Колір
|
||||
pdfToImage.grey=Відтінки сірого
|
||||
pdfToImage.blackwhite=Чорно-білий (може втратити дані!)
|
||||
pdfToImage.submit=Конвертувати
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=Diện tích đường viền tối thiểu:
|
||||
ScannerImageSplit.selectText.8=Đặt ngưỡng diện tích đường viền tối thiểu cho một ảnh
|
||||
ScannerImageSplit.selectText.9=Kích thước viền:
|
||||
ScannerImageSplit.selectText.10=Đặt kích thước của viền được thêm vào và loại bỏ để ngăn chặn viền trắng trong đầu ra (mặc định: 1).
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=Màu
|
||||
pdfToImage.grey=Thang độ xám
|
||||
pdfToImage.blackwhite=Đen trắng (Có thể mất dữ liệu!)
|
||||
pdfToImage.submit=Chuyển đổi
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=最小轮廓面积:
|
||||
ScannerImageSplit.selectText.8=设置照片的最小轮廓面积阈值。
|
||||
ScannerImageSplit.selectText.9=边框尺寸:
|
||||
ScannerImageSplit.selectText.10=设置添加和删除的边框大小,以防止输出中出现白边(默认值:1)。
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=颜色
|
||||
pdfToImage.grey=灰度
|
||||
pdfToImage.blackwhite=黑白(可能会丢失数据!)。
|
||||
pdfToImage.submit=转换
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -775,6 +775,7 @@ ScannerImageSplit.selectText.7=最小輪廓區域:
|
||||
ScannerImageSplit.selectText.8=設定照片的最小輪廓區域閾值
|
||||
ScannerImageSplit.selectText.9=邊框大小:
|
||||
ScannerImageSplit.selectText.10=設定新增和移除的邊框大小,以防止輸出中的白色邊框(預設:1)。
|
||||
ScannerImageSplit.info=Python is not installed. It is required to run.
|
||||
|
||||
|
||||
#OCR
|
||||
@ -925,6 +926,7 @@ pdfToImage.color=顏色
|
||||
pdfToImage.grey=灰度
|
||||
pdfToImage.blackwhite=黑白(可能會遺失資料!)
|
||||
pdfToImage.submit=轉換
|
||||
pdfToImage.info=Python is not installed. Required for WebP conversion.
|
||||
|
||||
|
||||
#addPassword
|
||||
|
@ -18,7 +18,9 @@
|
||||
<span class="tool-header-text" th:text="#{home.ScannerImageSplit.title}"></span>
|
||||
</div>
|
||||
|
||||
<form id="multiPdfForm" th:action="@{'/api/v1/misc/extract-image-scans'}" method="post" enctype="multipart/form-data">
|
||||
<p th:if="${!isPython}" th:text="#{ScannerImageSplit.info}" class="alert alert-success text-center">Python is not installed. It is required to run.</p>
|
||||
|
||||
<form th:if="${isPython}" id="multiPdfForm" th:action="@{'/api/v1/misc/extract-image-scans'}" method="post" enctype="multipart/form-data">
|
||||
<div th:replace="~{fragments/common :: fileSelector(name='fileInput', multiple=false, accept='image/*, application/pdf')}"></div>
|
||||
<div class="mb-3">
|
||||
<label for="angleThreshold" th:text="#{ScannerImageSplit.selectText.1}"></label>
|
||||
|
Loading…
Reference in New Issue
Block a user