Giter VIP home page Giter VIP logo

Comments (9)

garak avatar garak commented on August 27, 2024

The metadata mentioned in the documentation are Doctrine metadata, not image metadata.
How do you perform the image rotation?

from vichuploaderbundle.

Mgt03 avatar Mgt03 commented on August 27, 2024

I've open my picture with the default photo app of my computer, and I have rotate the image with it and save it.
This action modify the image ['Orientation'] parameter

from vichuploaderbundle.

garak avatar garak commented on August 27, 2024

So does the image have the metadata after this operation?
If you try to do a manual image upload with a simple PHP script, do you get the same metadata loss?

from vichuploaderbundle.

Mgt03 avatar Mgt03 commented on August 27, 2024

Okay, I can describe more with an example.
Firstly, I download or I take a picture
bmw s1000RR
At this moment, the metadatas of the picture are :

array(7) {
  ["FileName"]=>
  string(11) "classic.jpg"
  ["FileDateTime"]=>
  int(1711023627)
  ["FileSize"]=>
  int(8620)
  ["FileType"]=>
  int(2)
  ["MimeType"]=>
  string(10) "image/jpeg"
  ["SectionsFound"]=>
  string(0) ""
  ["COMPUTED"]=>
  array(4) {
    ["html"]=>
    string(24) "width="244" height="207""
    ["Height"]=>
    int(207)
    ["Width"]=>
    int(244)
    ["IsColor"]=>
    int(1)
  }
} 

I rotate it with windows and I save it
bmw s1000RR - retournée
At this moment, the metadatas of the picture are :

array(9) {
  ["FileName"]=>
  string(12) "original.jpg"
  ["FileDateTime"]=>
  int(1711527777)
  ["FileSize"]=>
  int(13668)
  ["FileType"]=>
  int(2)
  ["MimeType"]=>
  string(10) "image/jpeg"
  ["SectionsFound"]=>
  string(24) "ANY_TAG, IFD0, THUMBNAIL"
  ["COMPUTED"]=>
  array(7) {
    ["html"]=>
    string(24) "width="244" height="207""
    ["Height"]=>
    int(207)
    ["Width"]=>
    int(244)
    ["IsColor"]=>
    int(1)
    ["ByteOrderMotorola"]=>
    int(1)
    ["Thumbnail.FileType"]=>
    int(2)
    ["Thumbnail.MimeType"]=>
    string(10) "image/jpeg"
  }
  ["Orientation"]=>
  int(3)
  ["THUMBNAIL"]=>
  array(6) {
    ["Compression"]=>
    int(6)
    ["XResolution"]=>
    string(4) "96/1"
    ["YResolution"]=>
    string(4) "96/1"
    ["ResolutionUnit"]=>
    int(2)
    ["JPEGInterchangeFormat"]=>
    int(120)
    ["JPEGInterchangeFormatLength"]=>
    int(4914)
  }
}

I upload it in my app with Vich Uploader and the result is :
660412264d5d7087015010
At this moment, the metadatas of the picture are :

array(7) {
  ["FileName"]=>
  string(26) "660412264d5d7087015010.jpg"
  ["FileDateTime"]=>
  int(1711542822)
  ["FileSize"]=>
  int(7072)
  ["FileType"]=>
  int(2)
  ["MimeType"]=>
  string(10) "image/jpeg"
  ["SectionsFound"]=>
  string(0) ""
  ["COMPUTED"]=>
  array(4) {
    ["html"]=>
    string(24) "width="244" height="207""
    ["Height"]=>
    int(207)
    ["Width"]=>
    int(244)
    ["IsColor"]=>
    int(1)
  }
}

So, the file is not realy impacted by this modification, but the metadatas change. It seems that VichUploader deletes these metadatas, which has the effect of removing this defined orientation because the image is not originally upside down.

from vichuploaderbundle.

garak avatar garak commented on August 27, 2024

I'm not aware of any metadata handling here.
I invite you again to try uploading a file without this bundle and checking the outcome.

from vichuploaderbundle.

Mgt03 avatar Mgt03 commented on August 27, 2024

I found the origin of my problem, it's on our side, sorry for the inconvenience.

from vichuploaderbundle.

bresam avatar bresam commented on August 27, 2024

@Mgt03 any hint what it was on your side? Possibly it can help me too.

from vichuploaderbundle.

Mgt03 avatar Mgt03 commented on August 27, 2024

Hi @bresam,
I don't think this is really helpful for you, but this problem was due to an optimization function in my image, where I explicitly remove all metadata from the image I loaded.
So no link to the Vich Bundle
After deleting this part of my code, it works perfectly.

from vichuploaderbundle.

bresam avatar bresam commented on August 27, 2024

@Mgt03 Thank you anyway. Found the issue in a Post Upload Event Listener where we did something similar 👍

from vichuploaderbundle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.