Skip to content

Commit 7f9bbeb

Browse files
jbrunton96Frooodle
andauthored
Unify creditCosts.ts files (Stirling-Tools#5952)
Co-authored-by: Anthony Stirling <77850077+Frooodle@users.noreply.github.com>
1 parent dbff058 commit 7f9bbeb

8 files changed

Lines changed: 48 additions & 140 deletions

File tree

app/core/src/main/java/stirling/software/SPDF/model/api/PDFExtractImagesRequest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@
99
@EqualsAndHashCode(callSuper = true)
1010
public class PDFExtractImagesRequest extends PDFWithImageFormatRequest {
1111

12-
@Schema(
13-
description =
14-
"Boolean to enable/disable the saving of duplicate images, true to enable"
15-
+ " duplicates",
16-
defaultValue = "false")
17-
private Boolean allowDuplicates;
12+
// @Schema(
13+
// description =
14+
// "Boolean to enable/disable the saving of duplicate images, true to enable"
15+
// + " duplicates",
16+
// defaultValue = "false")
17+
// private Boolean allowDuplicates;
1818
}

frontend/src/core/components/tools/extractImages/ExtractImagesSettings.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useTranslation } from 'react-i18next';
2-
import { Stack, Select, Checkbox } from '@mantine/core';
2+
import { Stack, Select } from '@mantine/core';
33
import { ExtractImagesParameters } from '@app/hooks/tools/extractImages/useExtractImagesParameters';
44
import { Z_INDEX_AUTOMATE_DROPDOWN } from "@app/styles/zIndex";
55

@@ -35,12 +35,12 @@ const ExtractImagesSettings = ({
3535
comboboxProps={{ withinPortal: true, zIndex: Z_INDEX_AUTOMATE_DROPDOWN }}
3636
/>
3737

38-
<Checkbox
38+
{/* <Checkbox
3939
label={t('extractImages.allowDuplicates', 'Allow Duplicate Images')}
4040
checked={parameters.allowDuplicates}
4141
onChange={(event) => onParameterChange('allowDuplicates', event.currentTarget.checked)}
4242
disabled={disabled}
43-
/>
43+
/> */}
4444
</Stack>
4545
);
4646
};

frontend/src/core/hooks/tools/extractImages/useExtractImagesOperation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export const buildExtractImagesFormData = (parameters: ExtractImagesParameters,
1010
const formData = new FormData();
1111
formData.append("fileInput", file);
1212
formData.append("format", parameters.format);
13-
formData.append("allowDuplicates", parameters.allowDuplicates.toString());
13+
// formData.append("allowDuplicates", parameters.allowDuplicates.toString());
1414
return formData;
1515
};
1616

frontend/src/core/hooks/tools/extractImages/useExtractImagesParameters.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import { useBaseParameters } from '@app/hooks/tools/shared/useBaseParameters';
22

33
export interface ExtractImagesParameters {
44
format: 'png' | 'jpg' | 'gif';
5-
allowDuplicates: boolean;
5+
// allowDuplicates: boolean;
66
}
77

88
export const defaultParameters: ExtractImagesParameters = {
99
format: 'png',
10-
allowDuplicates: false,
10+
// allowDuplicates: false,
1111
};
1212

1313
export const useExtractImagesParameters = () => {
File renamed without changes.

frontend/src/saas/utils/creditCosts.ts

Lines changed: 0 additions & 92 deletions
This file was deleted.

testing/cucumber/features/general.feature

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -70,21 +70,21 @@ Feature: API Validation
7070
| 1 | 10 | 2 | 10 |
7171

7272

73-
@extract-images
74-
Scenario Outline: Extract Image Scans duplicates
75-
Given I use an example file at "exampleFiles/images.pdf" as parameter "fileInput"
76-
And the request data includes
77-
| parameter | value |
78-
| format | <format> |
79-
When I send the API request to the endpoint "/api/v1/misc/extract-images"
80-
Then the response content type should be "application/octet-stream"
81-
And the response file should have extension ".zip"
82-
And the response ZIP should contain 2 files
83-
And the response file should have size greater than 0
84-
And the response status code should be 200
85-
86-
Examples:
87-
| format |
88-
| png |
89-
| gif |
90-
| jpeg |
73+
# @extract-images
74+
# Scenario Outline: Extract Image Scans duplicates
75+
# Given I use an example file at "exampleFiles/images.pdf" as parameter "fileInput"
76+
# And the request data includes
77+
# | parameter | value |
78+
# | format | <format> |
79+
# When I send the API request to the endpoint "/api/v1/misc/extract-images"
80+
# Then the response content type should be "application/octet-stream"
81+
# And the response file should have extension ".zip"
82+
# And the response ZIP should contain 2 files
83+
# And the response file should have size greater than 0
84+
# And the response status code should be 200
85+
#
86+
# Examples:
87+
# | format |
88+
# | png |
89+
# | gif |
90+
# | jpeg |

testing/cucumber/features/general_new.feature

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -231,21 +231,21 @@ Feature: General PDF Operations API Validation
231231
And the response file should have size greater than 200
232232

233233

234-
@remove-image-pdf @positive
235-
Scenario: remove-image-pdf strips images from a PDF containing images
236-
Given I generate a PDF file as "fileInput"
237-
And the pdf contains 3 images of size 100x100 on 2 pages
238-
When I send the API request to the endpoint "/api/v1/general/remove-image-pdf"
239-
Then the response content type should be "application/pdf"
240-
And the response status code should be 200
241-
And the response file should have size greater than 0
242-
243-
244-
@remove-image-pdf @positive
245-
Scenario: remove-image-pdf on a plain text PDF returns a PDF
246-
Given I generate a PDF file as "fileInput"
247-
And the pdf contains 3 pages with random text
248-
When I send the API request to the endpoint "/api/v1/general/remove-image-pdf"
249-
Then the response content type should be "application/pdf"
250-
And the response status code should be 200
251-
And the response file should have size greater than 0
234+
# @remove-image-pdf @positive
235+
# Scenario: remove-image-pdf strips images from a PDF containing images
236+
# Given I generate a PDF file as "fileInput"
237+
# And the pdf contains 3 images of size 100x100 on 2 pages
238+
# When I send the API request to the endpoint "/api/v1/general/remove-image-pdf"
239+
# Then the response content type should be "application/pdf"
240+
# And the response status code should be 200
241+
# And the response file should have size greater than 0
242+
#
243+
#
244+
# @remove-image-pdf @positive
245+
# Scenario: remove-image-pdf on a plain text PDF returns a PDF
246+
# Given I generate a PDF file as "fileInput"
247+
# And the pdf contains 3 pages with random text
248+
# When I send the API request to the endpoint "/api/v1/general/remove-image-pdf"
249+
# Then the response content type should be "application/pdf"
250+
# And the response status code should be 200
251+
# And the response file should have size greater than 0

0 commit comments

Comments
 (0)