Skip to content

Commit

Permalink
Fix broken writing of E57 files
Browse files Browse the repository at this point in the history
Introduced in 0601045
  • Loading branch information
asmaloney committed Jan 15, 2019
1 parent 7945868 commit a6f2845
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
libE57Format
==
- v2.0 (06 Jan 2019)
- v2.0.1 (15 Jan 2019)
- writing files was broken and would produce the following error:
Error: bad API function argument provided by user (E57_ERROR_BAD_API_ARGUMENT) (ImageFileImpl.cpp line 109)

- v2.0 (06 Jan 2019)
- forked from E57RefImpl
- removed all but the main sources for reading and writing E57 files
- now requires C++11
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ project(E57Format)
# developer adjustable version numbers
set(${PROJECT_NAME}_MAJOR_VERSION 2)
set(${PROJECT_NAME}_MINOR_VERSION 0)
set(${PROJECT_NAME}_PATCH_VERSION 1)

include(Tags)

Expand Down Expand Up @@ -92,7 +93,7 @@ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
add_definitions(-DWINDOWS)
endif()

add_definitions(-DREVISION_ID="${PROJECT_NAME}-${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}-${${PROJECT_NAME}_BUILD_TAG}")
add_definitions(-DREVISION_ID="${PROJECT_NAME}-${${PROJECT_NAME}_MAJOR_VERSION}.${${PROJECT_NAME}_MINOR_VERSION}.${${PROJECT_NAME}_PATCH_VERSION}-${${PROJECT_NAME}_BUILD_TAG}")

include_directories(
${PROJECT_BINARY_DIR}/include
Expand Down
2 changes: 1 addition & 1 deletion src/ImageFileImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ namespace e57
// Accept "w" or "r" modes
isWriter_ = (mode == "w");

if (mode != "r")
if ( !isWriter_ && (mode != "r") )
{
throw E57_EXCEPTION2(E57_ERROR_BAD_API_ARGUMENT, "mode=" + ustring(mode));
}
Expand Down

0 comments on commit a6f2845

Please sign in to comment.