Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22021

PAPI image/binary should avoid using orignal name & hitting filesystem node limits

    Details

      Description

      When creating image objects through the Public API, image content is placed directly in the legacy images root, for example:

          var/<something>/storage/images/1712-1-eng-GB/Chrysanthemum.jpg
      

      However in this case where the Content name is "test", it should be something like

          var/<something>/storage/images/171/2/1/eng-GB/test.jpg
      

      The example is just an example, this can be solved different ways, here it makes sure all id's are splinted per 3 digits, it could be 4. Also the language folder can be skipped if field is untranslatable, but only if this is easily achievable.

        Issue Links

          Activity

          André Rømcke created issue -
          André Rømcke made changes -
          Field Original Value New Value
          Description When creating image objects through the Public API, image content is placed directly in the legacy images root, for example:

              var/<something>/storage/images/1712-1-eng-GB/Chrysanthemum.jpg


          However in this case where the Content name is "test", it should be something like

              var/<something>/storage/images/171/2-1-eng-GB/Chrysanthemum.jpg
          André Rømcke made changes -
          Description When creating image objects through the Public API, image content is placed directly in the legacy images root, for example:

              var/<something>/storage/images/1712-1-eng-GB/Chrysanthemum.jpg


          However in this case where the Content name is "test", it should be something like

              var/<something>/storage/images/171/2-1-eng-GB/Chrysanthemum.jpg
          When creating image objects through the Public API, image content is placed directly in the legacy images root, for example:
          {noformat}
              var/<something>/storage/images/1712-1-eng-GB/Chrysanthemum.jpg
          {noformat}

          However in this case where the Content name is "test", it should be something like
          {noformat}
              var/<something>/storage/images/171/2-1-eng-GB/Chrysanthemum.jpg
          {noformat}
          André Rømcke made changes -
          Description When creating image objects through the Public API, image content is placed directly in the legacy images root, for example:
          {noformat}
              var/<something>/storage/images/1712-1-eng-GB/Chrysanthemum.jpg
          {noformat}

          However in this case where the Content name is "test", it should be something like
          {noformat}
              var/<something>/storage/images/171/2-1-eng-GB/Chrysanthemum.jpg
          {noformat}
          When creating image objects through the Public API, image content is placed directly in the legacy images root, for example:
          {noformat}
              var/<something>/storage/images/1712-1-eng-GB/Chrysanthemum.jpg
          {noformat}

          However in this case where the Content name is "test", it should be something like
          {noformat}
              var/<something>/storage/images/171/2-1-eng-GB/test.jpg
          {noformat}
          André Rømcke made changes -
          Description When creating image objects through the Public API, image content is placed directly in the legacy images root, for example:
          {noformat}
              var/<something>/storage/images/1712-1-eng-GB/Chrysanthemum.jpg
          {noformat}

          However in this case where the Content name is "test", it should be something like
          {noformat}
              var/<something>/storage/images/171/2-1-eng-GB/test.jpg
          {noformat}
          When creating image objects through the Public API, image content is placed directly in the legacy images root, for example:
          {noformat}
              var/<something>/storage/images/1712-1-eng-GB/Chrysanthemum.jpg
          {noformat}

          However in this case where the Content name is "test", it should be something like
          {noformat}
              var/<something>/storage/images/171/2/1/eng-GB/test.jpg
          {noformat}

          The example is just an example, this can be solved different ways, here it makes sure all id's are splinted per 3 digits, it could be 4. Also the language folder can be skipped if field is untranslatable, but only if this is easily archivable.
          Bertrand Dunogier made changes -
          Description When creating image objects through the Public API, image content is placed directly in the legacy images root, for example:
          {noformat}
              var/<something>/storage/images/1712-1-eng-GB/Chrysanthemum.jpg
          {noformat}

          However in this case where the Content name is "test", it should be something like
          {noformat}
              var/<something>/storage/images/171/2/1/eng-GB/test.jpg
          {noformat}

          The example is just an example, this can be solved different ways, here it makes sure all id's are splinted per 3 digits, it could be 4. Also the language folder can be skipped if field is untranslatable, but only if this is easily archivable.
          When creating image objects through the Public API, image content is placed directly in the legacy images root, for example:
          {noformat}
              var/<something>/storage/images/1712-1-eng-GB/Chrysanthemum.jpg
          {noformat}

          However in this case where the Content name is "test", it should be something like
          {noformat}
              var/<something>/storage/images/171/2/1/eng-GB/test.jpg
          {noformat}

          The example is just an example, this can be solved different ways, here it makes sure all id's are splinted per 3 digits, it could be 4. Also the language folder can be skipped if field is untranslatable, but only if this is easily achievable.
          André Rømcke made changes -
          Status Open [ 1 ] Confirmed [ 10037 ]
          André Rømcke made changes -
          Status Confirmed [ 10037 ] InputQ [ 10001 ]
          Hide
          Bertrand Dunogier added a comment - - edited

          Do we have anything that does string transformation yet in the Public API to sanitize the name to an URI ?

          We have faced such issues in the past, but I don't think we had to deal with this so far in eZ 5. The closest we have for now would be the SlugConverter we use for URL aliases.

          Show
          Bertrand Dunogier added a comment - - edited Do we have anything that does string transformation yet in the Public API to sanitize the name to an URI ? We have faced such issues in the past, but I don't think we had to deal with this so far in eZ 5. The closest we have for now would be the SlugConverter we use for URL aliases.
          Hide
          Bertrand Dunogier added a comment -

          Wouldn't it make sense to try the alternative text first, then the content's name if there's none ? It could make more sense when there are more than one image.

          Show
          Bertrand Dunogier added a comment - Wouldn't it make sense to try the alternative text first, then the content's name if there's none ? It could make more sense when there are more than one image.
          Bertrand Dunogier made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Bertrand Dunogier [ bertrand.dunogier@ez.no ]
          Bertrand Dunogier made changes -
          Remaining Estimate 0 minutes [ 0 ]
          Time Spent 4 hours [ 14400 ]
          Worklog Id 42658 [ 42658 ]
          Bertrand Dunogier logged work - 26/Nov/13 10:50 PM
          • Time Spent:
            4 hours
             

            .

          Hide
          André Rømcke added a comment -

          > Wouldn't it make sense to try the alternative text first, then the content's name if there's none ? It could make more sense when there are more than one image.

          yes

          As for existing code, that would be question for [~jerome.vieilledent@ez.no] and Petar Spanja.

          Show
          André Rømcke added a comment - > Wouldn't it make sense to try the alternative text first, then the content's name if there's none ? It could make more sense when there are more than one image. yes As for existing code, that would be question for [~jerome.vieilledent@ez.no] and Petar Spanja .
          Hide
          Petar Spanja (Inactive) added a comment -

          @Bertrand Dunogier

          SlugConverter could definitely be used for this, but first it should be moved up to the eZ\Publish\Core\Persistence namespace.

          Also +1 for using alt text first.

          Show
          Petar Spanja (Inactive) added a comment - @ Bertrand Dunogier SlugConverter could definitely be used for this, but first it should be moved up to the eZ\Publish\Core\Persistence namespace. Also +1 for using alt text first.
          Hide
          Bertrand Dunogier added a comment - - edited

          After discussing it here, some people (and I could actually agree) think that using the uploaded filename was actually a better solution:

          • it doesn't enforce a business rule that may or may not fit each user
          • it works as it did before
          • it gives freedom to really optimize how your files are named if you need to
          Show
          Bertrand Dunogier added a comment - - edited After discussing it here, some people (and I could actually agree) think that using the uploaded filename was actually a better solution: it doesn't enforce a business rule that may or may not fit each user it works as it did before it gives freedom to really optimize how your files are named if you need to
          Hide
          Bertrand Dunogier added a comment -
          Show
          Bertrand Dunogier added a comment - ezpublish-kernel#638
          Bertrand Dunogier made changes -
          Status Development [ 3 ] Development review [ 10006 ]
          Bertrand Dunogier made changes -
          Remote Link This issue links to "ezpublish-kernel#638 (Web Link)" [ 12932 ]
          Hide
          Bertrand Dunogier added a comment - - edited

          ezpublish-kernel#638 merged to ezpublish-kernel/master in e85c03b.

          Show
          Bertrand Dunogier added a comment - - edited ezpublish-kernel#638 merged to ezpublish-kernel/master in e85c03b .
          Bertrand Dunogier made changes -
          Status Development review [ 10006 ] Development Review done [ 10028 ]
          Fix Version/s 5.3 [ 11282 ]
          Fix Version/s 5.1 Maintenance [ 12301 ]
          Fix Version/s 5.2 Maintenance [ 12782 ]
          Hide
          Bertrand Dunogier added a comment -

          Documentation: need to mention how files stored by the FieldType are structured, and by whom (PathGenerator).

          Show
          Bertrand Dunogier added a comment - Documentation: need to mention how files stored by the FieldType are structured, and by whom (PathGenerator).
          Bertrand Dunogier made changes -
          Status Development Review done [ 10028 ] Development Acceptance Done [ 10030 ]
          Bertrand Dunogier made changes -
          Time Spent 4 hours [ 14400 ] 1 day, 4 hours [ 43200 ]
          Worklog Id 42760 [ 42760 ]
          Hide
          Bertrand Dunogier added a comment - - edited

          Documentation updated.

          Added https://confluence.ez.no/display/EZP/The+Image+FieldType, that (briefly) explains how images are stored. Linked from https://confluence.ez.no/display/EZP/FieldTypes.

          Should the doc be backported to the previous versions spaces ?

          Show
          Bertrand Dunogier added a comment - - edited Documentation updated. Added https://confluence.ez.no/display/EZP/The+Image+FieldType , that (briefly) explains how images are stored. Linked from https://confluence.ez.no/display/EZP/FieldTypes . Should the doc be backported to the previous versions spaces ?
          Bertrand Dunogier logged work - 30/Nov/13 1:11 PM
          • Time Spent:
            1 day
             

            .

          Bertrand Dunogier made changes -
          Fix Version/s 5.1 Maintenance [ 12301 ]
          Fix Version/s 5.2 Maintenance [ 12782 ]
          Bertrand Dunogier made changes -
          Status Development Acceptance Done [ 10030 ] Documentation done [ 10011 ]
          Joao Pingo (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Bertrand Dunogier [ bertrand.dunogier@ez.no ] Joao Pingo [ joao.pingo@ez.no ]
          Joao Pingo (Inactive) made changes -
          Status QA [ 10008 ] InputQ [ 10001 ]
          Assignee Joao Pingo [ joao.pingo@ez.no ]
          Joao Pingo (Inactive) logged work - 02/Dec/13 12:37 PM
          • Time Spent:
            3 hours, 30 minutes
             

            Testing

          Joao Pingo (Inactive) made changes -
          Time Spent 1 day, 4 hours [ 43200 ] 1 day, 7 hours, 30 minutes [ 55800 ]
          Worklog Id 42853 [ 42853 ]
          Hide
          Bertrand Dunogier added a comment -

          Damn... I went back & forth through multiple implementations, and didn't think I had ended up with this one.

          Not sure what I'll do, but it does sound like a recommit... the alternative would be to completely revert this, and ship a new, independent patch.

          Show
          Bertrand Dunogier added a comment - Damn... I went back & forth through multiple implementations, and didn't think I had ended up with this one. Not sure what I'll do, but it does sound like a recommit... the alternative would be to completely revert this, and ship a new, independent patch.
          Bertrand Dunogier made changes -
          Status InputQ [ 10001 ] Development [ 3 ]
          Assignee Bertrand Dunogier [ bertrand.dunogier@ez.no ]
          Hide
          Bertrand Dunogier added a comment - - edited

          Okay. The previously referenced commits will have to be ignored.

          I have made a new PR that:

          • reverts the previously merged fix
          • refixes the issue, with corrections.

          New pull-request: ezpublish-kernel#641.

          Show
          Bertrand Dunogier added a comment - - edited Okay. The previously referenced commits will have to be ignored. I have made a new PR that: reverts the previously merged fix refixes the issue, with corrections. New pull-request: ezpublish-kernel#641 .
          Bertrand Dunogier made changes -
          Remote Link This issue links to "PR #2 ezpublish-kernel#641 (Web Link)" [ 12940 ]
          Bertrand Dunogier made changes -
          Status Development [ 3 ] Development review [ 10006 ]
          Joao Pingo (Inactive) logged work - 03/Dec/13 1:00 AM
          • Time Spent:
            2 hours
             

            Testing

          Show
          Bertrand Dunogier added a comment - ezpublish-kernel#641 merged to ezpublish-kernel/master@84dda86 .
          Bertrand Dunogier made changes -
          Status Development review [ 10006 ] Development Review done [ 10028 ]
          Bertrand Dunogier made changes -
          Status Development Review done [ 10028 ] Documentation done [ 10011 ]
          Joao Pingo (Inactive) made changes -
          Status Documentation done [ 10011 ] QA [ 10008 ]
          Assignee Bertrand Dunogier [ bertrand.dunogier@ez.no ] Joao Pingo [ joao.pingo@ez.no ]
          Joao Pingo (Inactive) made changes -
          Time Spent 1 day, 7 hours, 30 minutes [ 55800 ] 2 days, 1 hour, 30 minutes [ 63000 ]
          Worklog Id 43236 [ 43236 ]
          Hide
          Joao Pingo (Inactive) added a comment -

          QA Approved

          Show
          Joao Pingo (Inactive) added a comment - QA Approved
          Joao Pingo (Inactive) made changes -
          Assignee Joao Pingo [ joao.pingo@ez.no ]
          Status QA [ 10008 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Joao Pingo (Inactive) logged work - 04/Dec/13 12:27 PM - edited
          • Time Spent:
            2 hours
             

            Closed

          Joao Pingo (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Joao Pingo (Inactive) made changes -
          Time Spent 2 days, 1 hour, 30 minutes [ 63000 ] 2 days, 3 hours [ 68400 ]
          Worklog Id 43246 [ 43246 ]
          Joao Pingo (Inactive) made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Joao Pingo (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Joao Pingo (Inactive) made changes -
          Time Spent 2 days, 3 hours [ 68400 ] 2 days, 3 hours, 30 minutes [ 70200 ]
          Worklog Id 43246 [ 43246 ]
          Joao Pingo (Inactive) made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Joao Pingo (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Joao Pingo (Inactive) made changes -
          Time Spent 2 days, 3 hours, 30 minutes [ 70200 ] 3 days, 30 minutes [ 88200 ]
          Worklog Id 43291 [ 43291 ]
          Joao Pingo (Inactive) made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          Joao Pingo (Inactive) made changes -
          Resolution Fixed [ 1 ]
          Status Closed [ 6 ] Reopened [ 4 ]
          Joao Pingo (Inactive) made changes -
          Remaining Estimate 0 minutes [ 0 ] 5 hours [ 18000 ]
          Time Spent 3 days, 30 minutes [ 88200 ] 2 days, 3 hours, 30 minutes [ 70200 ]
          Worklog Id 43291 [ 43291 ]
          Worklog Time Spent 5 hours [ 18000 ]
          Joao Pingo (Inactive) made changes -
          Status Reopened [ 4 ] Closed [ 6 ]
          Resolution Fixed [ 1 ]
          André Rømcke made changes -
          Workflow eZ Engineering Scrumban Workflow [ 60236 ] EZ* Development Workflow [ 84550 ]
          Alex Schuster made changes -
          Workflow EZ* Development Workflow [ 84550 ] EZEE Development Workflow [ 123210 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Open Open Confirmed Confirmed
          15m 12s 1 André Rømcke 26/Nov/13 3:48 PM
          Confirmed Confirmed InputQ InputQ
          2s 1 André Rømcke 26/Nov/13 3:49 PM
          Development Review done Development Review done Removed Status Removed Status
          10m 15s 1 Bertrand Dunogier 30/Nov/13 12:11 PM
          Removed Status Removed Status Documentation Review done Documentation Review done
          1h 18m 1 Bertrand Dunogier 30/Nov/13 1:30 PM
          QA QA InputQ InputQ
          2h 57m 1 Joao Pingo (Inactive) 02/Dec/13 12:31 PM
          InputQ InputQ Development Development
          8h 53m 2 Bertrand Dunogier 02/Dec/13 3:44 PM
          Development Development Development Review Development Review
          1d 20h 14m 2 Bertrand Dunogier 02/Dec/13 4:16 PM
          Development Review Development Review Development Review done Development Review done
          2d 13h 39m 2 Bertrand Dunogier 03/Dec/13 11:07 AM
          Development Review done Development Review done Documentation Review done Documentation Review done
          6s 1 Bertrand Dunogier 03/Dec/13 11:07 AM
          Documentation Review done Documentation Review done QA QA
          2d 1h 1m 2 Joao Pingo (Inactive) 03/Dec/13 4:05 PM
          QA QA Closed Closed
          18h 17m 1 Joao Pingo (Inactive) 04/Dec/13 10:22 AM
          Closed Closed Reopened Reopened
          1d 7h 10m 4 Joao Pingo (Inactive) 05/Dec/13 5:33 PM
          Reopened Reopened Closed Closed
          15s 4 Joao Pingo (Inactive) 05/Dec/13 5:33 PM

            People

            • Assignee:
              Unassigned
              Reporter:
              André Rømcke
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Time Spent - 2 days, 3 hours, 30 minutes Remaining Estimate - 5 hours
                5h
                Logged:
                Time Spent - 2 days, 3 hours, 30 minutes Remaining Estimate - 5 hours
                2d 3h 30m