3

I followed the instructions here to show already existing files on the dropzone area.

The problem is that the files appear cropped. See this image:

left is existing, right is new dragged

How should I go about fixing this? Has someone else seen this as well?

Community
  • 1
  • 1
Ramon Tayag
  • 15,224
  • 9
  • 43
  • 69

2 Answers2

4

I fixed it by adding this css selector:

.dropzone{
  .dz-preview{
    .dz-image{
      img{
        height: 120px;
        width:120px;
        object-fit: cover;
      }
    }
  }
}
Vladimir Mootin
  • 118
  • 1
  • 7
0

The thumbnail you provide must be square.

Unlike what seems to be the behaviour of the newly dragged images, for added files, Dropzone will scale the picture and attempt to fit it in the image. That means if your image is wider than it is tall, you may see white space like the image shown in the question.

Ramon Tayag
  • 15,224
  • 9
  • 43
  • 69
  • Unfortunately, not always do we have images in one single form. The fix provided by Vladimir Mootin works well for all images. – Odd Oct 23 '18 at 10:42