Giter Club home page Giter Club logo

Comments (6)

adamroyle avatar adamroyle commented on August 23, 2024 3

The problem is not in detecting the mime type - the problem is the regression in functionality. The previous code would detect the mime type from a base64'd value of the data, whereas the new code uses mime_content_type() of the URL, which doesn't work because it's a url and not a file location.

I'm not sure why this code was changed, but I see the following options:

  1. Revert this change OR
  2. Save the file contents to a temporary file before using mime_content_type()

from vcard.

axelitus avatar axelitus commented on August 23, 2024 1

I have the same issue. mime_content_type() does not work with urls, just local filenames. If the media contents has been already downloaded why not use that to verify the mime type and do another request just to figure it out? I don't understand this change...

Reverting this change works fine. Hopefully @jeroendesloovere shares his thoughts on this.

from vcard.

claytoncollie avatar claytoncollie commented on August 23, 2024

for a quick fix change line 218 to $mimetype = 'image/jpeg'; if you are adding a jpg of course.

from vcard.

devnix avatar devnix commented on August 23, 2024

Why not trying something like this? https://github.com/trippo/ResponsiveFilemanager/blob/master/filemanager/include/mime_type_lib.php

from vcard.

ApeWare avatar ApeWare commented on August 23, 2024

Doing some updates and ran into this exact issue. We store our images on s3 and pass the url to addPhoto($url) and now we are getting the mime_content_type() error.

Is there a reason for this breaking change other than to reduce the library by 3 lines of code? Debating on forking and rolling back this change, but would prefer to understand why the change was important.

from vcard.

ifunk avatar ifunk commented on August 23, 2024

Instead of forking we have just fixed our version at 1.2.2. At this time there's no need for us to upgrade to a newer version as we've been running it in production for over a year and have had no issues.

from vcard.

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.