Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CZIcmd FATAL ERROR: std::exception caught -> ios_base::badbit set: iostream stream error #125

Open
dmagee opened this issue Jan 7, 2025 · 1 comment

Comments

@dmagee
Copy link

dmagee commented Jan 7, 2025

Describe the bug
When I try to extract a label image with CZIcmd itreports the following error:

FATAL ERROR: std::exception caught
 -> ios_base::badbit set: iostream stream error

To Reproduce
-Build latest release with MSVC 2017 using CMake (default parameters, nothing changed except to enable CZIcmd build, and untick LIBCZI_BUILD_PREFER_EXTERNALPACKAGE_RAPIDJSON)

-Use the command line:
CZIcmd.exe -c ExtractAttachment -s C:\Users\derek\Downloads\2024_10_04__8198.czi --output attachments --selection {\"name\":\"Label\"}

The file is an H&E (RGB) image with 2 scenes

Note: The following works fine:

CZIcmd.exe -c PrintInformation -s C:\Users\derek\Downloads\2024_10_04__8198.czi --info-level AllAttachments
Complete list of Attachments

index | filetype | GUID | name
------+----------+----------------------------------------+-------------
0 | CZEVL | {4BA4217A-93BB-4B57-9985-84BEF6B0A0CE} | EventList
1 | CZTIMS | {7A33BFFC-C70C-4331-B318-3D3720B09178} | TimeStamps
2 | CZI | {EE65F66B-22E9-4521-BC8E-30BC00DB8D6E} | Label
3 | CZI | {843D9270-A6EE-4547-81A7-30E6E04592CF} | SlidePreview
4 | Zip-Comp | {8378557B-8935-4B81-BCC4-A7DFE07DFAC5} | Profile
5 | JPG | {12FCC366-FEC5-4916-9723-1C2379758555} | Thumbnail

As does:

CZIcmd.exe -c PrintInformation -s C:\Users\derek\Downloads\2024_10_04__8198.czi
SubBlock-Statistics

SubBlock-Count: 3705

Bounding-Box:
All: X=-221760 Y=24835 W=149978 H=60661
Layer0: X=-221734 Y=24835 W=149952 H=60546

M-Index: min=0 max=1179

Bounds:
C -> Start=0 Size=1
S -> Start=0 Size=2

Bounding-Box for scenes:
Scene0:
All: X=-221760 Y=26994 W=52046 H=58502
Layer0: X=-221734 Y=26994 W=52020 H=58387
Scene1:
All: X=-122400 Y=24835 W=50618 H=58501
Layer0: X=-122382 Y=24835 W=50600 H=58376

The image loads fine in the ZEN viewer

Expected behavior
A file containing just the label image should be written

Desktop (please complete the following information):

  • OS: Windows 10
    -Compiler MSVC 2017
@ptahmose
Copy link
Contributor

ptahmose commented Jan 13, 2025

At first glance and with the information provided, I unfortunately cannot reproduce the issue. I tried the operation and did not encounter any problems.

Some suggestions:

  • Perhaps try the operation with a binary from the GitHub-Actions build (e.g. from here).
  • Can you run the operation with a debugger attached and gather more information?
  • Can you make the CZI-document available?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants