diff --git a/Graphics/drawContext.cpp b/Graphics/drawContext.cpp
index 0827f40e35794c9300ec9196816d52af3236dddb..4734f2471b93985447d69af6c1e71cf4ab016f93 100644
--- a/Graphics/drawContext.cpp
+++ b/Graphics/drawContext.cpp
@@ -417,6 +417,7 @@ bool drawContext::generateTextureForImage(const std::string &name, int page,
         return false;
       }
       Fl_RGB_Image *img2 = (Fl_RGB_Image*)img->copy(2048, 2048);
+      glPixelStorei(GL_UNPACK_ROW_LENGTH, img2->w());
       glGenTextures(1, &imageTexture);
       glBindTexture(GL_TEXTURE_2D, imageTexture);
       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);