dellepiane: fixed file opening in AddIntrinsics
This commit is contained in:
parent
4e6f8f55f5
commit
761172501b
|
|
@ -189,13 +189,9 @@ static bool ReadImagesFilenames(const char * filename,std::vector<std::string>
|
||||||
static bool AddIntrinsics(vcg::Shotf &shot, const char * image_file)
|
static bool AddIntrinsics(vcg::Shotf &shot, const char * image_file)
|
||||||
{
|
{
|
||||||
::ResetJpgfile();
|
::ResetJpgfile();
|
||||||
QFile img(image_file);
|
FILE * pFile = fopen(image_file, "rb");
|
||||||
img.open(QIODevice::ReadWrite);
|
|
||||||
int FileDescriptor = img.handle();
|
|
||||||
FILE* pFile = fdopen(FileDescriptor, "rb");
|
|
||||||
if (!pFile) return false;
|
|
||||||
int ret = ::ReadJpegSections (pFile, READ_METADATA);
|
int ret = ::ReadJpegSections (pFile, READ_METADATA);
|
||||||
img.close();
|
fclose(pFile);
|
||||||
|
|
||||||
shot.Intrinsics.ViewportPx = vcg::Point2i(ImageInfo.Width, ImageInfo.Height);
|
shot.Intrinsics.ViewportPx = vcg::Point2i(ImageInfo.Width, ImageInfo.Height);
|
||||||
shot.Intrinsics.CenterPx = vcg::Point2f(float(ImageInfo.Width/2.0), float(ImageInfo.Height/2.0));
|
shot.Intrinsics.CenterPx = vcg::Point2f(float(ImageInfo.Width/2.0), float(ImageInfo.Height/2.0));
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue