Skip to content

Function camera_calibration_parser::readCalibrationIni() fails if the INI file is read-only #397

@dfischer42

Description

@dfischer42

Our calibration data is usually read-only to prevent accidental modifications. Unfortunately, this becomes a problem when the data is stored as an INI file, as the function camera_calibration_parser::readCalibrationIni() uses

std::fstream fs(file_name);

By default, files are opened in read-write mode in this way. With read-only files, this inevitably leads to an error. Simple solution is to use std::istream instead of std::fstream. For the time being, our local version uses

bool readCalibrationIni(
  const std::string & file_name, std::string & camera_name,
  CameraInfo & cam_info)
{
  std::ifstream fs(file_name);
  return readCalibrationIni(fs, camera_name, cam_info);
}

and works as expected. It would be nice to see this fixed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions