diff --git a/src/PIL/WebPImagePlugin.py b/src/PIL/WebPImagePlugin.py
index eda685508..77a02e4b9 100644
--- a/src/PIL/WebPImagePlugin.py
+++ b/src/PIL/WebPImagePlugin.py
@@ -38,6 +38,8 @@ class WebPImageFile(ImageFile.ImageFile):
 
     format = "WEBP"
     format_description = "WebP image"
+    __loaded = 0
+    __logical_frame = 0
 
     def _open(self):
         if not _webp.HAVE_WEBPANIM:

Webp images cannot be pickled
### What did you do?

I'm trying to pickle and unpickle webp images. My code works for other image formats, but fails for webp images. For example, run the following code with [this image](https://github.com/python-pillow/Pillow/files/4485578/image.zip) (compressed because GitHub doesn't support webp files):

```python
from PIL import Image
import pickle

image = Image.open('image.webp')
unpickled_image = pickle.loads(pickle.dumps(image))
resized_image = unpickled_image.resize((50, 50))
```

### What did you expect to happen?

A resized `Image` instance should have been created.

### What actually happened?

The following error was thrown:

```
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/seppe/.local/lib/python3.7/site-packages/PIL/Image.py", line 1886, in resize
    self.load()
  File "/home/seppe/.local/lib/python3.7/site-packages/PIL/WebPImagePlugin.py", line 156, in load
    if self.__loaded != self.__logical_frame:
AttributeError: 'WebPImageFile' object has no attribute '_WebPImageFile__loaded'
```

### What are your OS, Python and Pillow versions?

* OS: Ubuntu 19.10
* Python: 3.7.5
* Pillow: 7.1.1
diff --git a/Tests/test_pickle.py b/Tests/test_pickle.py
index ba4868988..4bf6d586a 100644
--- a/Tests/test_pickle.py
+++ b/Tests/test_pickle.py
@@ -1,11 +1,16 @@
 import pickle
 
+import pytest
 from PIL import Image
 
+from .helper import skip_unless_feature
 
-def helper_pickle_file(tmp_path, pickle, protocol=0, mode=None):
+
+def helper_pickle_file(
+    tmp_path, pickle, protocol=0, test_file="Tests/images/hopper.jpg", mode=None
+):
     # Arrange
-    with Image.open("Tests/images/hopper.jpg") as im:
+    with Image.open(test_file) as im:
         filename = str(tmp_path / "temp.pkl")
         if mode:
             im = im.convert(mode)
@@ -35,41 +40,30 @@ def helper_pickle_string(
         assert im == loaded_im
 
 
-def test_pickle_image(tmp_path):
-    # Act / Assert
-    for protocol in range(0, pickle.HIGHEST_PROTOCOL + 1):
-        helper_pickle_string(pickle, protocol)
-        helper_pickle_file(tmp_path, pickle, protocol)
-
-
-def test_pickle_p_mode():
-    # Act / Assert
-    for test_file in [
-        "Tests/images/test-card.png",
-        "Tests/images/zero_bb.png",
-        "Tests/images/zero_bb_scale2.png",
-        "Tests/images/non_zero_bb.png",
-        "Tests/images/non_zero_bb_scale2.png",
-        "Tests/images/p_trns_single.png",
-        "Tests/images/pil123p.png",
-        "Tests/images/itxt_chunks.png",
-    ]:
-        for protocol in range(0, pickle.HIGHEST_PROTOCOL + 1):
-            helper_pickle_string(pickle, protocol=protocol, test_file=test_file)
-
-
-def test_pickle_pa_mode(tmp_path):
-    # Act / Assert
-    for protocol in range(0, pickle.HIGHEST_PROTOCOL + 1):
-        helper_pickle_string(pickle, protocol, mode="PA")
-        helper_pickle_file(tmp_path, pickle, protocol, mode="PA")
-
-
-def test_pickle_l_mode(tmp_path):
+@pytest.mark.parametrize(
+    ("test_file", "test_mode"),
+    [
+        ("Tests/images/hopper.jpg", None),
+        ("Tests/images/hopper.jpg", "L"),
+        ("Tests/images/hopper.jpg", "PA"),
+        pytest.param(
+            "Tests/images/hopper.webp", None, marks=skip_unless_feature("webp")
+        ),
+        ("Tests/images/test-card.png", None),
+        ("Tests/images/zero_bb.png", None),
+        ("Tests/images/zero_bb_scale2.png", None),
+        ("Tests/images/non_zero_bb.png", None),
+        ("Tests/images/non_zero_bb_scale2.png", None),
+        ("Tests/images/p_trns_single.png", None),
+        ("Tests/images/pil123p.png", None),
+        ("Tests/images/itxt_chunks.png", None),
+    ],
+)
+def test_pickle_image(tmp_path, test_file, test_mode):
     # Act / Assert
     for protocol in range(0, pickle.HIGHEST_PROTOCOL + 1):
-        helper_pickle_string(pickle, protocol, mode="L")
-        helper_pickle_file(tmp_path, pickle, protocol, mode="L")
+        helper_pickle_string(pickle, protocol, test_file, test_mode)
+        helper_pickle_file(tmp_path, pickle, protocol, test_file, test_mode)
 
 
 def test_pickle_la_mode_with_palette(tmp_path):
@@ -88,3 +82,15 @@ def test_pickle_la_mode_with_palette(tmp_path):
 
         im.mode = "PA"
         assert im == loaded_im
+
+
+@skip_unless_feature("webp")
+def test_pickle_tell():
+    # Arrange
+    image = Image.open("Tests/images/hopper.webp")
+
+    # Act: roundtrip
+    unpickled_image = pickle.loads(pickle.dumps(image))
+
+    # Assert
+    assert unpickled_image.tell() == 0

pip install -e .[dev]
parse_log_pytest
requirements.txt
apt-get update apt-get install -y gcc libjpeg-dev zlib1g-dev libtiff5-dev libfreetype6-dev liblcms2-dev libwebp-dev tcl8.6-dev tk8.6-dev libharfbuzz-dev libfribidi-dev libxcb1-dev
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.16
babel==2.17.0
black==25.1.0
blessed==1.20.0
build==1.2.2.post1
certifi==2025.1.31
charset-normalizer==3.4.1
check-manifest==0.50
click==8.1.8
coverage==7.8.0
docutils==0.21.2
exceptiongroup==1.2.2
idna==3.10
imagesize==1.4.1
importlib_metadata==8.6.1
iniconfig==2.1.0
jarn.viewdoc==2.7
Jinja2==3.1.6
MarkupSafe==3.0.2
mypy-extensions==1.0.0
olefile==0.47
packaging==24.2
pathspec==0.12.1
-e git+https://github.com/python-pillow/Pillow.git@97280a045cc2544ef8855dac2765e765565772cd#egg=Pillow
platformdirs==4.3.7
pluggy==1.5.0
pycodestyle==2.13.0
pyflakes==3.3.1
Pygments==2.19.1
pyproject_hooks==1.2.0
pyroma==4.2
pytest==8.3.5
pytest-cov==6.0.0
requests==2.32.3
six==1.17.0
snowballstemmer==2.2.0
Sphinx==7.4.7
sphinx-rtd-theme==3.0.2
sphinxcontrib-applehelp==2.0.0
sphinxcontrib-devhelp==2.0.0
sphinxcontrib-htmlhelp==2.1.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==2.0.0
sphinxcontrib-serializinghtml==2.0.0
tomli==2.2.1
trove-classifiers==2025.3.19.19
typing_extensions==4.13.0
urllib3==2.3.0
wcwidth==0.2.13
zipp==3.21.0

name: Pillow
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tzdata=2025a=h04d1e81_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.16
      - babel==2.17.0
      - black==25.1.0
      - blessed==1.20.0
      - build==1.2.2.post1
      - certifi==2025.1.31
      - charset-normalizer==3.4.1
      - check-manifest==0.50
      - click==8.1.8
      - coverage==7.8.0
      - docutils==0.21.2
      - exceptiongroup==1.2.2
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - jarn-viewdoc==2.7
      - jinja2==3.1.6
      - markupsafe==3.0.2
      - mypy-extensions==1.0.0
      - olefile==0.47
      - packaging==24.2
      - pathspec==0.12.1
      - platformdirs==4.3.7
      - pluggy==1.5.0
      - pycodestyle==2.13.0
      - pyflakes==3.3.1
      - pygments==2.19.1
      - pyproject-hooks==1.2.0
      - pyroma==4.2
      - pytest==8.3.5
      - pytest-cov==6.0.0
      - requests==2.32.3
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==7.4.7
      - sphinx-rtd-theme==3.0.2
      - sphinxcontrib-applehelp==2.0.0
      - sphinxcontrib-devhelp==2.0.0
      - sphinxcontrib-htmlhelp==2.1.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==2.0.0
      - sphinxcontrib-serializinghtml==2.0.0
      - tomli==2.2.1
      - trove-classifiers==2025.3.19.19
      - typing-extensions==4.13.0
      - urllib3==2.3.0
      - wcwidth==0.2.13
      - zipp==3.21.0
prefix: /opt/conda/envs/Pillow

Tests/test_pickle.py::test_pickle_image[Tests/images/hopper.webp-None] Tests/test_pickle.py::test_pickle_tell
Tests/test_pickle.py::test_pickle_image[Tests/images/hopper.jpg-None] Tests/test_pickle.py::test_pickle_image[Tests/images/hopper.jpg-L] Tests/test_pickle.py::test_pickle_image[Tests/images/hopper.jpg-PA] Tests/test_pickle.py::test_pickle_image[Tests/images/test-card.png-None] Tests/test_pickle.py::test_pickle_image[Tests/images/zero_bb.png-None] Tests/test_pickle.py::test_pickle_image[Tests/images/zero_bb_scale2.png-None] Tests/test_pickle.py::test_pickle_image[Tests/images/non_zero_bb.png-None] Tests/test_pickle.py::test_pickle_image[Tests/images/non_zero_bb_scale2.png-None] Tests/test_pickle.py::test_pickle_image[Tests/images/p_trns_single.png-None] Tests/test_pickle.py::test_pickle_image[Tests/images/pil123p.png-None] Tests/test_pickle.py::test_pickle_image[Tests/images/itxt_chunks.png-None] Tests/test_pickle.py::test_pickle_la_mode_with_palette
src/PIL/WebPImagePlugin.py
src/PIL/WebPImagePlugin.py