Skip to content

Commit

Permalink
fix EMData::write_images for non-hdf formats
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowwalkersb committed May 27, 2024
1 parent 0dbdad4 commit 28e0364
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion libEM/emdata_io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,7 @@ bool EMData::write_images(const string & filename, vector<std::shared_ptr<EMData
}

LOGVAR("getimageio %d",rwmode);
ImageIO *imageio = EMUtil::get_imageio(filename, rwmode);
ImageIO *imageio = EMUtil::get_imageio(filename, rwmode, imgtype);

if(imgtype == EMUtil::IMAGE_TIFF && idxs != 0)
throw ImageWriteException(imageio->get_filename(), "Offset specification for TIFF writes is not supported.");
Expand Down
6 changes: 3 additions & 3 deletions libpyEM/EMAN2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3106,11 +3106,11 @@ def db_write_images(fsp,

#print(f"PY {im['render_min']} - {im['render_max']} {im['minimum']} - {im['maximum']} {im['render_bits']}")
if bits < 0:
EMData.write_images_c(fsp, imgs, idxs) # bits<0 implies no compression
return EMData.write_images_c(fsp, imgs, idxs) # bits<0 implies no compression
else:
EMData.write_images_c(fsp, imgs, idxs, EMUtil.ImageType.IMAGE_UNKNOWN, 0, None, EMUtil.EMDataType.EM_COMPRESSED)
return EMData.write_images_c(fsp, imgs, idxs, EMUtil.ImageType.IMAGE_UNKNOWN, 0, None, EMUtil.EMDataType.EM_COMPRESSED)
else:
EMData.write_images_c(fsp, imgs, idxs, imgtype, header_only, reqion, filestoragetype, use_host_endian)
return EMData.write_images_c(fsp, imgs, idxs, imgtype, header_only, reqion, filestoragetype, use_host_endian)

EMData.write_images_c = staticmethod(EMData.write_images)
EMData.write_images = staticmethod(db_write_images)
Expand Down

0 comments on commit 28e0364

Please sign in to comment.