diff --git a/src/PIL/SpiderImagePlugin.py b/src/PIL/SpiderImagePlugin.py
index 5663a5b53..f1cae4d9f 100644
--- a/src/PIL/SpiderImagePlugin.py
+++ b/src/PIL/SpiderImagePlugin.py
@@ -236,7 +236,7 @@ def loadImageSeries(filelist=None):
 def makeSpiderHeader(im):
     nsam, nrow = im.size
     lenbyt = nsam * 4  # There are labrec records in the header
-    labrec = 1024 / lenbyt
+    labrec = int(1024 / lenbyt)
     if 1024 % lenbyt != 0:
         labrec += 1
     labbyt = labrec * lenbyt

Spider format header bug for random image size
### What did you do?
I am trying to save `float` image in `SPIDER` format

### What did you expect to happen?
I accepted it to work for any image size.

### What actually happened?
The saved spider file has corrupt header when the width of the image is not a power of 2. 

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

* OS: Windows 10 
* Python: 3.6
* Pillow: 6.1.1

```python
from PIL import Image
import numpy as np

filename= "im.spi"
width = 100  # change it to any natural number not a power of 2
im = np.random.random((64, width))-1
pil_image = Image.fromarray(im, 'F')
pil_image.save(filename, format='SPIDER')

im2 = Image.open(filename)
print(im2.size)
```

I was able to trace the bug to [this](https://github.com/python-pillow/Pillow/blob/master/src/PIL/SpiderImagePlugin.py#L239) line.
Changing the line from `labrec = 1024 / lenbyt` to `labrec = int(1024 / lenbyt)` fixes the bug for me. 

diff --git a/Tests/test_file_spider.py b/Tests/test_file_spider.py
index 8a1eb6637..340208486 100644
--- a/Tests/test_file_spider.py
+++ b/Tests/test_file_spider.py
@@ -1,4 +1,5 @@
 import tempfile
+from io import BytesIO
 
 from PIL import Image, ImageSequence, SpiderImagePlugin
 
@@ -117,3 +118,14 @@ class TestImageSpider(PillowTestCase):
         for i, frame in enumerate(ImageSequence.Iterator(im)):
             if i > 1:
                 self.fail("Non-stack DOS file test failed")
+
+    # for issue #4093
+    def test_odd_size(self):
+        data = BytesIO()
+        width = 100
+        im = Image.new("F", (width, 64))
+        im.save(data, format="SPIDER")
+
+        data.seek(0)
+        im2 = Image.open(data)
+        self.assert_image_equal(im, im2)

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
coveralls==4.0.1
docopt==0.6.2
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@26babb525a6a83393dcb88001ae20e603f7aa7fb#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
      - coveralls==4.0.1
      - docopt==0.6.2
      - 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_file_spider.py::TestImageSpider::test_odd_size
Tests/test_file_spider.py::TestImageSpider::test_invalid_file Tests/test_file_spider.py::TestImageSpider::test_isInt_not_a_number Tests/test_file_spider.py::TestImageSpider::test_isSpiderImage Tests/test_file_spider.py::TestImageSpider::test_loadImageSeries Tests/test_file_spider.py::TestImageSpider::test_loadImageSeries_no_input Tests/test_file_spider.py::TestImageSpider::test_n_frames Tests/test_file_spider.py::TestImageSpider::test_nonstack_dos Tests/test_file_spider.py::TestImageSpider::test_nonstack_file Tests/test_file_spider.py::TestImageSpider::test_sanity Tests/test_file_spider.py::TestImageSpider::test_save Tests/test_file_spider.py::TestImageSpider::test_tell Tests/test_file_spider.py::TestImageSpider::test_tempfile Tests/test_file_spider.py::TestImageSpider::test_unclosed_file
src/PIL/SpiderImagePlugin.py
src/PIL/SpiderImagePlugin.py