{
  "id": 145892,
  "title": "ValueError: cannot decompress jpeg",
  "url": "/competitions/prostate-cancer-grade-assessment/discussion/145892",
  "author_name": "TheStoneMX",
  "post_date": "2020-04-25T00:10:43.052000",
  "votes": 1,
  "comment_count": 12,
  "views": 0,
  "content": "<p>Hi there all, </p>\n\n<p>I am trying to run code on my computer, but I keep getting this error, and cant find a solution on the web.\nd, rgbonly, scale_mdgel, memmap, reopen, maxsize)\n   2484                 self.sample_format, self.bits_per_sample))\n   2485         if self.compression not in TIFF_DECOMPESSORS:\n-&gt; 2486             raise ValueError(\"cannot decompress %s\" % self.compression)\n   2487         if 'sample_format' in self.tags:\n   2488             tag = self.tags['sample_format']</p>\n\n<p>ValueError: cannot decompress jpeg</p>\n\n<p>tried to install the imagecodecs, but I get another error. </p>\n\n<pre><code>imagecodecs/opj_color.c:45:10: fatal error: openjpeg.h: No such file or directory\n #include \"openjpeg.h\"\n          ^~~~~~~~~~~~\ncompilation terminated.\nerror: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n</code></pre>\n\n<p>thanks for help.</p>",
  "messages": [
    {
      "id": 868908,
      "postDate": "2020-05-31T15:04:03.360Z",
      "content": "<p>Installing these solved my problem \n1. pip install imagecodecs \n2. pip install tifffile [ I used conda-forge for this ] </p>",
      "rawMarkdown": "Installing these solved my problem \n1. pip install imagecodecs \n2. pip install tifffile [ I used conda-forge for this ] ",
      "votes": 3,
      "replies": [
        {
          "id": 877395,
          "postDate": "2020-06-07T15:05:05.743Z",
          "content": "<p>tried these but didn't work T^T, keep researching...</p>",
          "rawMarkdown": "tried these but didn't work T^T, keep researching...",
          "isDeleted": true
        },
        {
          "id": 922417,
          "postDate": "2020-07-10T05:09:47.530Z",
          "content": "<p>thx, it's work for me.</p>",
          "rawMarkdown": "thx, it's work for me."
        }
      ]
    },
    {
      "id": 819892,
      "postDate": "2020-04-25T00:49:30.323Z",
      "content": "<p>Found some of the problems....</p>\n\n<p>I needed to install : <a href=\"https://gitlab.dkrz.de/k202009/libaec/-/blob/master/INSTALL\">https://gitlab.dkrz.de/k202009/libaec/-/blob/master/INSTALL</a>\ngit clone <a href=\"https://gitlab.dkrz.de/k202009/libaec.git\">https://gitlab.dkrz.de/k202009/libaec.git</a></p>\n\n<h2>Installation from source code release with CMake</h2>\n\n<p>use CMake to install libaec.</p>\n\n<p>Unpack the tar archive and change into the directory.</p>\n\n<p>mkdir build\n  cd build\n  cmake ..\n  make install</p>\n\n<p>got installed fine, but now is asking for : blosc.h</p>",
      "rawMarkdown": "Found some of the problems....\n\nI needed to install : https://gitlab.dkrz.de/k202009/libaec/-/blob/master/INSTALL\ngit clone https://gitlab.dkrz.de/k202009/libaec.git\n\n## Installation from source code release with CMake\n\nuse CMake to install libaec.\n\nUnpack the tar archive and change into the directory.\n\n  mkdir build\n  cd build\n  cmake ..\n  make install\n\ngot installed fine, but now is asking for : blosc.h\n",
      "votes": 1,
      "replies": [
        {
          "id": 819897,
          "postDate": "2020-04-25T01:03:23.710Z",
          "content": "<p>needed to install \nfirst - <a href=\"https://pypi.org/project/scikit-build/\">https://pypi.org/project/scikit-build/</a>\nsecond - <a href=\"https://pypi.org/project/blosc/\">https://pypi.org/project/blosc/</a></p>",
          "rawMarkdown": "needed to install \nfirst - https://pypi.org/project/scikit-build/\nsecond - https://pypi.org/project/blosc/\n",
          "votes": 1
        },
        {
          "id": 836855,
          "postDate": "2020-05-07T09:54:51.873Z",
          "content": "<p>Hi <a href=\"/oscarrangel\">@oscarrangel</a> ! Thanks for taking the time to document this hassle ^^</p>\n\n<p>I've followed the steps for libaec with cmake, and got : </p>\n\n<p><code>\nInstall the project...\n-- Install configuration: \"Release\"\n-- Installing: /usr/local/lib/libaec.so.0.0.10\n-- Up-to-date: /usr/local/lib/libaec.so.0\n-- Up-to-date: /usr/local/lib/libaec.so\n-- Installing: /usr/local/lib/libsz.so.2.0.1\n-- Up-to-date: /usr/local/lib/libsz.so.2\n-- Set runtime path of \"/usr/local/lib/libsz.so.2.0.1\" to \"\"\n-- Up-to-date: /usr/local/lib/libsz.so\n-- Up-to-date: /usr/local/share/man/man1/aec.1\n-- Up-to-date: /usr/local/include/libaec.h\n-- Up-to-date: /usr/local/include/szlib.h\n-- Installing: /usr/local/include/libaec_Export.h\n-- Installing: /usr/local/bin/aec\n-- Set runtime path of \"/usr/local/bin/aec\" to \"\"\n</code></p>\n\n<p>Does this look like a correct install to you ? No error reported, but that hasn't helped with the tifffile/jpeg thing...</p>",
          "rawMarkdown": "Hi @oscarrangel ! Thanks for taking the time to document this hassle ^^\n\nI've followed the steps for libaec with cmake, and got : \n\n```\nInstall the project...\n-- Install configuration: \"Release\"\n-- Installing: /usr/local/lib/libaec.so.0.0.10\n-- Up-to-date: /usr/local/lib/libaec.so.0\n-- Up-to-date: /usr/local/lib/libaec.so\n-- Installing: /usr/local/lib/libsz.so.2.0.1\n-- Up-to-date: /usr/local/lib/libsz.so.2\n-- Set runtime path of \"/usr/local/lib/libsz.so.2.0.1\" to \"\"\n-- Up-to-date: /usr/local/lib/libsz.so\n-- Up-to-date: /usr/local/share/man/man1/aec.1\n-- Up-to-date: /usr/local/include/libaec.h\n-- Up-to-date: /usr/local/include/szlib.h\n-- Installing: /usr/local/include/libaec_Export.h\n-- Installing: /usr/local/bin/aec\n-- Set runtime path of \"/usr/local/bin/aec\" to \"\"\n```\n\nDoes this look like a correct install to you ? No error reported, but that hasn't helped with the tifffile/jpeg thing...\n"
        },
        {
          "id": 837034,
          "postDate": "2020-05-07T13:19:33.770Z",
          "content": "<p>Hi <a href=\"/bdubreu\">@bdubreu</a> what code are you using to open the tiff files? this is what I am using.</p>\n\n<pre><code>    img = skimage.io.MultiImage(os.path.join(TRAIN,name+'.tiff'), conserve_memory=False)[1]\n\n    image_0 = Image.fromarray(img, mode='RGB')\n</code></pre>",
          "rawMarkdown": "Hi @bdubreu what code are you using to open the tiff files? this is what I am using.\n\n        img = skimage.io.MultiImage(os.path.join(TRAIN,name+'.tiff'), conserve_memory=False)[1]\n\n        image_0 = Image.fromarray(img, mode='RGB')\n"
        },
        {
          "id": 837964,
          "postDate": "2020-05-08T07:30:06.910Z",
          "content": "<p>Hi ! thanks for your answer... I was using that too. Apparently skimage decided that they would not support tifffile (the package) anymore. I tried your solution to no avail ^^</p>\n\n<p>So I changed the code to use openslide on my local laptop ^^</p>\n\n<p>Thanks for documenting this though, this might be helpful to someone else than me !</p>",
          "rawMarkdown": "Hi ! thanks for your answer... I was using that too. Apparently skimage decided that they would not support tifffile (the package) anymore. I tried your solution to no avail ^^\n\n So I changed the code to use openslide on my local laptop ^^\n\nThanks for documenting this though, this might be helpful to someone else than me !"
        }
      ]
    },
    {
      "id": 819870,
      "postDate": "2020-04-25T00:10:43.053Z",
      "content": "<p>Hi there all, </p>\n\n<p>I am trying to run code on my computer, but I keep getting this error, and cant find a solution on the web.\nd, rgbonly, scale_mdgel, memmap, reopen, maxsize)\n   2484                 self.sample_format, self.bits_per_sample))\n   2485         if self.compression not in TIFF_DECOMPESSORS:\n-&gt; 2486             raise ValueError(\"cannot decompress %s\" % self.compression)\n   2487         if 'sample_format' in self.tags:\n   2488             tag = self.tags['sample_format']</p>\n\n<p>ValueError: cannot decompress jpeg</p>\n\n<p>tried to install the imagecodecs, but I get another error. </p>\n\n<pre><code>imagecodecs/opj_color.c:45:10: fatal error: openjpeg.h: No such file or directory\n #include \"openjpeg.h\"\n          ^~~~~~~~~~~~\ncompilation terminated.\nerror: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n</code></pre>\n\n<p>thanks for help.</p>",
      "rawMarkdown": "Hi there all, \n\nI am trying to run code on my computer, but I keep getting this error, and cant find a solution on the web.\nd, rgbonly, scale_mdgel, memmap, reopen, maxsize)\n   2484                 self.sample_format, self.bits_per_sample))\n   2485         if self.compression not in TIFF_DECOMPESSORS:\n-&gt; 2486             raise ValueError(\"cannot decompress %s\" % self.compression)\n   2487         if 'sample_format' in self.tags:\n   2488             tag = self.tags['sample_format']\n\nValueError: cannot decompress jpeg\n\n tried to install the imagecodecs, but I get another error. \n\n    imagecodecs/opj_color.c:45:10: fatal error: openjpeg.h: No such file or directory\n     #include \"openjpeg.h\"\n              ^~~~~~~~~~~~\n    compilation terminated.\n    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n\n\nthanks for help.\n",
      "votes": 1
    },
    {
      "id": 890064,
      "postDate": "2020-06-17T09:35:35.683Z",
      "content": "<p>Try to update your scikit-image to 0.17.2. I solve this same problem with it.</p>",
      "rawMarkdown": "Try to update your scikit-image to 0.17.2. I solve this same problem with it."
    },
    {
      "id": 851865,
      "postDate": "2020-05-18T01:33:55.753Z",
      "content": "<p>I'm having the same issue with tifffile. Any luck with other options?</p>",
      "rawMarkdown": "I'm having the same issue with tifffile. Any luck with other options?"
    },
    {
      "id": 819903,
      "postDate": "2020-04-25T01:23:05.993Z",
      "content": "<p>Just need to use <code>pip install tifffile</code></p>",
      "rawMarkdown": "Just need to use `pip install tifffile`",
      "replies": [
        {
          "id": 819951,
          "postDate": "2020-04-25T03:31:07.683Z",
          "content": "<p>thanks, but needed other things</p>",
          "rawMarkdown": "thanks, but needed other things"
        }
      ]
    }
  ],
  "comments": [
    {
      "id": 868908,
      "author_name": "remisharoon",
      "author_url": "",
      "post_date": "2020-05-31T15:04:03.360000",
      "content": "<p>Installing these solved my problem \n1. pip install imagecodecs \n2. pip install tifffile [ I used conda-forge for this ] </p>",
      "votes": 3,
      "replies": [
        {
          "id": 877395,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-06-07T15:05:05.743000",
          "content": "<p>tried these but didn't work T^T, keep researching...</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 922417,
          "author_name": "",
          "author_url": "",
          "post_date": "2020-07-10T05:09:47.530000",
          "content": "<p>thx, it's work for me.</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 819892,
      "author_name": "TheStoneMX",
      "author_url": "",
      "post_date": "2020-04-25T00:49:30.323000",
      "content": "<p>Found some of the problems....</p>\n\n<p>I needed to install : <a href=\"https://gitlab.dkrz.de/k202009/libaec/-/blob/master/INSTALL\">https://gitlab.dkrz.de/k202009/libaec/-/blob/master/INSTALL</a>\ngit clone <a href=\"https://gitlab.dkrz.de/k202009/libaec.git\">https://gitlab.dkrz.de/k202009/libaec.git</a></p>\n\n<h2>Installation from source code release with CMake</h2>\n\n<p>use CMake to install libaec.</p>\n\n<p>Unpack the tar archive and change into the directory.</p>\n\n<p>mkdir build\n  cd build\n  cmake ..\n  make install</p>\n\n<p>got installed fine, but now is asking for : blosc.h</p>",
      "votes": 1,
      "replies": [
        {
          "id": 819897,
          "author_name": "TheStoneMX",
          "author_url": "",
          "post_date": "2020-04-25T01:03:23.710000",
          "content": "<p>needed to install \nfirst - <a href=\"https://pypi.org/project/scikit-build/\">https://pypi.org/project/scikit-build/</a>\nsecond - <a href=\"https://pypi.org/project/blosc/\">https://pypi.org/project/blosc/</a></p>",
          "votes": 1,
          "replies": []
        },
        {
          "id": 836855,
          "author_name": "Benjamin Dubreu",
          "author_url": "",
          "post_date": "2020-05-07T09:54:51.873000",
          "content": "<p>Hi <a href=\"/oscarrangel\">@oscarrangel</a> ! Thanks for taking the time to document this hassle ^^</p>\n\n<p>I've followed the steps for libaec with cmake, and got : </p>\n\n<p><code>\nInstall the project...\n-- Install configuration: \"Release\"\n-- Installing: /usr/local/lib/libaec.so.0.0.10\n-- Up-to-date: /usr/local/lib/libaec.so.0\n-- Up-to-date: /usr/local/lib/libaec.so\n-- Installing: /usr/local/lib/libsz.so.2.0.1\n-- Up-to-date: /usr/local/lib/libsz.so.2\n-- Set runtime path of \"/usr/local/lib/libsz.so.2.0.1\" to \"\"\n-- Up-to-date: /usr/local/lib/libsz.so\n-- Up-to-date: /usr/local/share/man/man1/aec.1\n-- Up-to-date: /usr/local/include/libaec.h\n-- Up-to-date: /usr/local/include/szlib.h\n-- Installing: /usr/local/include/libaec_Export.h\n-- Installing: /usr/local/bin/aec\n-- Set runtime path of \"/usr/local/bin/aec\" to \"\"\n</code></p>\n\n<p>Does this look like a correct install to you ? No error reported, but that hasn't helped with the tifffile/jpeg thing...</p>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 837034,
          "author_name": "TheStoneMX",
          "author_url": "",
          "post_date": "2020-05-07T13:19:33.770000",
          "content": "<p>Hi <a href=\"/bdubreu\">@bdubreu</a> what code are you using to open the tiff files? this is what I am using.</p>\n\n<pre><code>    img = skimage.io.MultiImage(os.path.join(TRAIN,name+'.tiff'), conserve_memory=False)[1]\n\n    image_0 = Image.fromarray(img, mode='RGB')\n</code></pre>",
          "votes": 0,
          "replies": []
        },
        {
          "id": 837964,
          "author_name": "Benjamin Dubreu",
          "author_url": "",
          "post_date": "2020-05-08T07:30:06.910000",
          "content": "<p>Hi ! thanks for your answer... I was using that too. Apparently skimage decided that they would not support tifffile (the package) anymore. I tried your solution to no avail ^^</p>\n\n<p>So I changed the code to use openslide on my local laptop ^^</p>\n\n<p>Thanks for documenting this though, this might be helpful to someone else than me !</p>",
          "votes": 0,
          "replies": []
        }
      ]
    },
    {
      "id": 890064,
      "author_name": "Jackeylove is dry",
      "author_url": "",
      "post_date": "2020-06-17T09:35:35.683000",
      "content": "<p>Try to update your scikit-image to 0.17.2. I solve this same problem with it.</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 851865,
      "author_name": "Adi Mithani",
      "author_url": "",
      "post_date": "2020-05-18T01:33:55.753000",
      "content": "<p>I'm having the same issue with tifffile. Any luck with other options?</p>",
      "votes": 0,
      "replies": []
    },
    {
      "id": 819903,
      "author_name": "Matt",
      "author_url": "",
      "post_date": "2020-04-25T01:23:05.993000",
      "content": "<p>Just need to use <code>pip install tifffile</code></p>",
      "votes": 0,
      "replies": [
        {
          "id": 819951,
          "author_name": "TheStoneMX",
          "author_url": "",
          "post_date": "2020-04-25T03:31:07.683000",
          "content": "<p>thanks, but needed other things</p>",
          "votes": 0,
          "replies": []
        }
      ]
    }
  ],
  "raw_markdown_by_id": {
    "868908": "Installing these solved my problem \n1. pip install imagecodecs \n2. pip install tifffile [ I used conda-forge for this ] ",
    "819892": "Found some of the problems....\n\nI needed to install : https://gitlab.dkrz.de/k202009/libaec/-/blob/master/INSTALL\ngit clone https://gitlab.dkrz.de/k202009/libaec.git\n\n## Installation from source code release with CMake\n\nuse CMake to install libaec.\n\nUnpack the tar archive and change into the directory.\n\n  mkdir build\n  cd build\n  cmake ..\n  make install\n\ngot installed fine, but now is asking for : blosc.h\n",
    "819870": "Hi there all, \n\nI am trying to run code on my computer, but I keep getting this error, and cant find a solution on the web.\nd, rgbonly, scale_mdgel, memmap, reopen, maxsize)\n   2484                 self.sample_format, self.bits_per_sample))\n   2485         if self.compression not in TIFF_DECOMPESSORS:\n-&gt; 2486             raise ValueError(\"cannot decompress %s\" % self.compression)\n   2487         if 'sample_format' in self.tags:\n   2488             tag = self.tags['sample_format']\n\nValueError: cannot decompress jpeg\n\n tried to install the imagecodecs, but I get another error. \n\n    imagecodecs/opj_color.c:45:10: fatal error: openjpeg.h: No such file or directory\n     #include \"openjpeg.h\"\n              ^~~~~~~~~~~~\n    compilation terminated.\n    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1\n\n\nthanks for help.\n",
    "890064": "Try to update your scikit-image to 0.17.2. I solve this same problem with it.",
    "851865": "I'm having the same issue with tifffile. Any luck with other options?",
    "819903": "Just need to use `pip install tifffile`"
  }
}