Announcement

Collapse
No announcement yet.

Lossless JPG crop error; Can't replace original JPG file

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    no bug Lossless JPG crop error; Can't replace original JPG file

    I am processing a bunch of images downloaded from Archive.org. As far as I know they were created uniformly with the same permissions, etc. But every so often - maybe 5% of the time or less - when I try to do a lossless crop I get an error message: "JPG Crop error: Can't replace original JPG file. (check write permissions)"

    This makes no sense to me since I am creating a new, cropped JPG, and the original is untouched. And other files with what seem to be the same permissions don't give me that error message.

    I'm using Irfanview 4.44 (32 bit) on Windows 10 Home build 17134. The plugin, JPG_transform.dll, is ver. 4.38.

    Any suggestions as to how I can overcome this error message would be appreciated. Thanks.

    Art
    Last edited by ArtMan; 27.06.2018, 04:32 PM. Reason: adding plugin version no.

    #2
    The first thing to try would be to update to the latest version 4.51 and the latest plugin. If there is a bug, it might have been fixed.
    Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

    Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

    Comment


      #3
      Originally posted by Bhikkhu Pesala View Post
      The first thing to try would be to update to the latest version 4.51 and the latest plugin. If there is a bug, it might have been fixed.
      As I expected, upgrading to the newest versions had no effect. The bug (or unexpected behavior) persists.

      One additional data point: When I try to crop using the standard, non-lossless procedure (edit|Crop Selection or CTRL-Y), it works fine.

      Thanks for any ideas you might have.

      Art

      Comment


        #4
        Please provide a link to the content that you're trying to crop.
        Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

        Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

        Comment


          #5
          • JPG_TRANSFORM - (version 4.51): allows IrfanView to support lossless JPG operations (rotation/crop/cleaning, EXIF date editing, EXIF thumb update)


          Click image for larger version

Name:	Lossless JPG Plugin.png
Views:	1
Size:	21.0 KB
ID:	83132
          Last edited by Bhikkhu Pesala; 28.06.2018, 11:36 AM.
          Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

          Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

          Comment


            #6
            Not sure what post #5 refers to. In any event ...

            A file exhibiting the described behavior can be found here:


            I had previously downloaded this file into my file system (deep in a verbose directory structure), and when I tried to do a lossless crop, I got the same error message I described above.

            But when I downloaded a fresh copy from the link above into my Downloads directory, I had no trouble doing the lossless crop. I verified (using hashmyfiles.exe) that the two files were bit-identical. Hmmm.

            Could it have something to do with the long length of the directory path plus filename? Apparently so. I copied the file that had given me trouble to the Downloads directory, where it had a much shorter full path, and voila: no problem.

            I am using Windows 10 Home, and supposedly there is a 260-character limit, though for some reason the problematic file location has a path+filename of just (!) 256 characters. Maybe there is a different limit in Irfanview 32 bit? Or does the problem arise when the "_crop" suffix is added, which may push the path+name over Windows' 260-character limit?

            The error message flagged a problem with the "original" jpg file, but I wonder if the issue isn't the cropped version, since the original remains untouched after the lossless crop operation.

            In any event, a more specific error message would be helpful.

            Thank you,
            Art

            Comment


              #7
              Post #5 shows you which plugin should be installed. Updating makes sure that we are all testing the same thing, eliminating the possibility that a bug has been fixed since the version that you are using.

              Although it could be a long file path, it seems more likely to be an issue with folder permissions. The file is not protected.
              Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

              Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

              Comment


                #8
                Yes, it does seem more likely, and that was my first thought. But I have repeatedly tested my theory that it is the path+filename length that is the issue, and I have found in every case when I got the error message that I described, I was successfully able to save the cropped image by shortening the file name. Other files with apparently-identical permissions but shorter filenames did not have this problem.

                Also, in post #3 I said that the error message didn't occur when I used Irfanview's native crop function, I believe I had saved the file in a different directory with a shorter path name. Just now I tried again. This time again I tried to crop a file that gave me trouble using the lossless plugin. Using the native crop function, I tried to save the cropped file in the same folder and with the same filename suffix (_crop) as with the lossless crop, and again, the cropped file wouldn't save ... because, I believe, the path+filename was too long.

                Art

                Comment


                  #9
                  I was able to reproduce the bug by creating a nested subfolder with a very long path name:

                  C:\TEMP\IrfanView 4.51 32-bit\Folder with a very long name to test IrfanViews Lossless Crop Plugin which wont save files in deeply nested folders\Another subfolder with a very long name to test the lossless crop plugin

                  I got this error message:

                  Click image for larger version

Name:	Lossless Crop Error.png
Views:	1
Size:	2.3 KB
ID:	83136

                  However, with the shorter path, the crop saved successfully:

                  C:\TEMP\IrfanView 4.51 32-bit\Folder with a very long name to test IrfanViews Lossless Crop Plugin which wont save files in deeply nested folders\

                  I have forwarded a bug report to Irfan Skiljan.
                  Last edited by Bhikkhu Pesala; 30.06.2018, 03:54 PM.
                  Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                  Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                  Comment


                    #10
                    Originally posted by Bhikkhu Pesala View Post
                    I was able to reproduce the bug by creating a nested subfolder with a very long path name:

                    ... I have forwarded a bug report to Irfan Skiljan.
                    To be clear: I don't think this is a "bug" per se. The failure-to-save part is because of Windows' path+filename length limitations. That said, the error message is confusing and unhelpful and should explain how to solve the problem, e.g. "Windows cannot accept this very long path+filename. Please shorten it to proceed."

                    Comment


                      #11
                      See this tip on allowing longer file names.

                      Yes, no doubt Irfan Skiljan will tell me that it is not a bug, but hopefully he can do something to fix the error message. If that is sent by Windows to IrfanView, then maybe that is also not possible.
                      Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                      Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                      Comment


                        #12
                        I heard back. It is not easy to fix the error message.

                        Originally posted by IrfanSkiljan
                        No, I can't change this easily ... the normal path-limit is used on maybe 1000 places in program code.
                        Before you post ... Edit your profile • IrfanView 4.62 • Windows 10 Home 19045.2486

                        Irfan PaintIrfan View HelpIrfanPaint HelpRiot.dllMore SkinsFastStone CaptureUploads

                        Comment

                        Working...
                        X