Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
4454aa54
Commit
4454aa54
authored
Dec 30, 2003
by
Ken Martin
Browse files
fix for warnings and other bad things
parent
0507a167
Changes
1
Hide whitespace changes
Inline
Side-by-side
IO/vtkJPEGWriter.cxx
View file @
4454aa54
...
...
@@ -24,7 +24,7 @@ extern "C" {
#include <setjmp.h>
}
vtkCxxRevisionMacro
(
vtkJPEGWriter
,
"1.2
2
"
);
vtkCxxRevisionMacro
(
vtkJPEGWriter
,
"1.2
3
"
);
vtkStandardNewMacro
(
vtkJPEGWriter
);
vtkCxxSetObjectMacro
(
vtkJPEGWriter
,
Result
,
vtkUnsignedCharArray
);
...
...
@@ -38,6 +38,7 @@ vtkJPEGWriter::vtkJPEGWriter()
this
->
Progressive
=
1
;
this
->
WriteToMemory
=
0
;
this
->
Result
=
0
;
this
->
TempFP
=
0
;
}
vtkJPEGWriter
::~
vtkJPEGWriter
()
...
...
@@ -230,11 +231,11 @@ void vtkJPEGWriter::WriteSlice(vtkImageData *data)
// Create the jpeg compression object and error handler
struct
jpeg_compress_struct
cinfo
;
struct
VTK_JPEG_ERROR_MANAGER
jerr
;
FILE
*
fp
=
0
;
this
->
TempFP
=
0
;
if
(
!
this
->
WriteToMemory
)
{
fp
=
fopen
(
this
->
InternalFileName
,
"wb"
);
if
(
!
fp
)
this
->
TempFP
=
fopen
(
this
->
InternalFileName
,
"wb"
);
if
(
!
this
->
TempFP
)
{
vtkErrorMacro
(
"Unable to open file "
<<
this
->
InternalFileName
);
this
->
SetErrorCode
(
vtkErrorCode
::
CannotOpenFileError
);
...
...
@@ -249,7 +250,7 @@ void vtkJPEGWriter::WriteSlice(vtkImageData *data)
jpeg_destroy_compress
(
&
cinfo
);
if
(
!
this
->
WriteToMemory
)
{
fclose
(
fp
);
fclose
(
this
->
TempFP
);
}
this
->
SetErrorCode
(
vtkErrorCode
::
OutOfDiskSpaceError
);
return
;
...
...
@@ -270,7 +271,7 @@ void vtkJPEGWriter::WriteSlice(vtkImageData *data)
}
else
{
jpeg_stdio_dest
(
&
cinfo
,
fp
);
jpeg_stdio_dest
(
&
cinfo
,
this
->
TempFP
);
}
// set the information about image
...
...
@@ -319,10 +320,10 @@ void vtkJPEGWriter::WriteSlice(vtkImageData *data)
if
(
!
this
->
WriteToMemory
)
{
if
(
fflush
(
fp
)
==
EOF
)
if
(
fflush
(
this
->
TempFP
)
==
EOF
)
{
this
->
ErrorCode
=
vtkErrorCode
::
OutOfDiskSpaceError
;
fclose
(
fp
);
fclose
(
this
->
TempFP
);
return
;
}
}
...
...
@@ -336,7 +337,7 @@ void vtkJPEGWriter::WriteSlice(vtkImageData *data)
if
(
!
this
->
WriteToMemory
)
{
fclose
(
fp
);
fclose
(
this
->
TempFP
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment