@gradio/image 0.9.12 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/Index.svelte +3 -0
- package/package.json +10 -7
- package/shared/ImageUploader.svelte +2 -0
package/CHANGELOG.md
CHANGED
@@ -1,5 +1,48 @@
|
|
1
1
|
# @gradio/image
|
2
2
|
|
3
|
+
## 0.10.0
|
4
|
+
|
5
|
+
### Highlights
|
6
|
+
|
7
|
+
#### Setting File Upload Limits ([#7909](https://github.com/gradio-app/gradio/pull/7909) [`2afca65`](https://github.com/gradio-app/gradio/commit/2afca6541912b37dc84f447c7ad4af21607d7c72))
|
8
|
+
|
9
|
+
We have added a `max_file_size` size parameter to `launch()` that limits to size of files uploaded to the server. This limit applies to each individual file. This parameter can be specified as a string or an integer (corresponding to the size in bytes).
|
10
|
+
|
11
|
+
The following code snippet sets a max file size of 5 megabytes.
|
12
|
+
|
13
|
+
```python
|
14
|
+
import gradio as gr
|
15
|
+
|
16
|
+
demo = gr.Interface(lambda x: x, "image", "image")
|
17
|
+
|
18
|
+
demo.launch(max_file_size="5mb")
|
19
|
+
# or
|
20
|
+
demo.launch(max_file_size=5 * gr.FileSize.MB)
|
21
|
+
```
|
22
|
+
|
23
|
+

|
24
|
+
|
25
|
+
|
26
|
+
#### Error states can now be cleared
|
27
|
+
|
28
|
+
When a component encounters an error, the error state shown in the UI can now be cleared by clicking on the `x` icon in the top right of the component. This applies to all types of errors, whether it's raised in the UI or the server.
|
29
|
+
|
30
|
+

|
31
|
+
|
32
|
+
Thanks @freddyaboulton!
|
33
|
+
|
34
|
+
### Fixes
|
35
|
+
|
36
|
+
- [#8066](https://github.com/gradio-app/gradio/pull/8066) [`624f9b9`](https://github.com/gradio-app/gradio/commit/624f9b9477f74a581a6c14119234f9efdfcda398) - make gradio dev tools a local dependency rather than bundling. Thanks @pngwn!
|
37
|
+
|
38
|
+
### Dependency updates
|
39
|
+
|
40
|
+
- @gradio/atoms@0.7.1
|
41
|
+
- @gradio/client@0.17.0
|
42
|
+
- @gradio/statustracker@0.5.0
|
43
|
+
- @gradio/upload@0.9.0
|
44
|
+
- @gradio/utils@0.4.0
|
45
|
+
|
3
46
|
## 0.9.12
|
4
47
|
|
5
48
|
### Dependency updates
|
package/Index.svelte
CHANGED
@@ -60,6 +60,7 @@
|
|
60
60
|
clear: never;
|
61
61
|
select: SelectData;
|
62
62
|
share: ShareData;
|
63
|
+
clear_status: LoadingStatus;
|
63
64
|
}>;
|
64
65
|
|
65
66
|
$: {
|
@@ -125,6 +126,7 @@
|
|
125
126
|
autoscroll={gradio.autoscroll}
|
126
127
|
i18n={gradio.i18n}
|
127
128
|
{...loading_status}
|
129
|
+
on:clear_status={() => gradio.dispatch("clear_status", loading_status)}
|
128
130
|
/>
|
129
131
|
|
130
132
|
<ImageUploader
|
@@ -152,6 +154,7 @@
|
|
152
154
|
{pending}
|
153
155
|
{streaming}
|
154
156
|
{mirror_webcam}
|
157
|
+
max_file_size={gradio.max_file_size}
|
155
158
|
i18n={gradio.i18n}
|
156
159
|
>
|
157
160
|
{#if active_source === "upload" || !active_source}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@gradio/image",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.10.0",
|
4
4
|
"description": "Gradio UI packages",
|
5
5
|
"type": "module",
|
6
6
|
"author": "",
|
@@ -10,13 +10,16 @@
|
|
10
10
|
"cropperjs": "^1.5.12",
|
11
11
|
"lazy-brush": "^1.0.1",
|
12
12
|
"resize-observer-polyfill": "^1.5.1",
|
13
|
-
"@gradio/
|
14
|
-
"@gradio/
|
13
|
+
"@gradio/client": "^0.17.0",
|
14
|
+
"@gradio/atoms": "^0.7.1",
|
15
|
+
"@gradio/upload": "^0.9.0",
|
16
|
+
"@gradio/utils": "^0.4.0",
|
17
|
+
"@gradio/wasm": "^0.10.0",
|
15
18
|
"@gradio/icons": "^0.4.0",
|
16
|
-
"@gradio/statustracker": "^0.
|
17
|
-
|
18
|
-
|
19
|
-
"@gradio/
|
19
|
+
"@gradio/statustracker": "^0.5.0"
|
20
|
+
},
|
21
|
+
"devDependencies": {
|
22
|
+
"@gradio/preview": "^0.8.0"
|
20
23
|
},
|
21
24
|
"main_changeset": true,
|
22
25
|
"main": "./Index.svelte",
|
@@ -25,6 +25,7 @@
|
|
25
25
|
export let selectable = false;
|
26
26
|
export let root: string;
|
27
27
|
export let i18n: I18nFormatter;
|
28
|
+
export let max_file_size: number | null = null;
|
28
29
|
|
29
30
|
let upload: Upload;
|
30
31
|
let uploading = false;
|
@@ -114,6 +115,7 @@
|
|
114
115
|
on:load={handle_upload}
|
115
116
|
on:error
|
116
117
|
{root}
|
118
|
+
{max_file_size}
|
117
119
|
disable_click={!sources.includes("upload")}
|
118
120
|
>
|
119
121
|
{#if value === null}
|