Comments (7)
Matt,
take a look at #67.
Effects are being preserved in File instance if it's created from a Group.
from uploadcare-php.
from uploadcare-php.
I don't see the benefit of accessing it via group over individual file, but it's your choice as to implement it or not. In my use-case, the user creates their own cropped image and I need to preserve those cropped dimensions.
In this case, are we encouraged to use File Groups?
from uploadcare-php.
@MattWohler the individual files do not store the cropping info in any form, it is only available in groups.
You'll have to save the file URL returned by the widget to have the cropping info.
So the question to you is what you're actually putting into your DB when you save files?
from uploadcare-php.
resolved in #67
from uploadcare-php.
id | user_id | avatar_uuid | avatar_crop_size |
---|---|---|---|
1 | 1 | b39ds8f39f-4387-4cc0-3118-bc49sh8984a7 | crop/239x239/145,24 |
Where my code ends up looking something like the following:
$fileUrl = $request->input('avatar');
$file = $this->api->getFile($fileUrl);
$startAt = strpos($fileUrl, 'crop');
$stopAt = strpos($fileUrl, '/-/preview');
$cropSize = substr($fileUrl, $startAt, ($stopAt - strlen($fileUrl)));
$userProfile->avatar_uuid = $file->getFileId();
$userProfile->avatar_crop_size = $cropSize;
from uploadcare-php.
Not sure if gihub is a good place for this :)
But anyway, if you instantiate File with full URL, returned by the widget, you get the cropping and your code successfully extracts it (take a look at $file->default_effects though).
Uploadcare does not have this info (for individual files), and hence cannot give it to you via REST API.
from uploadcare-php.
Related Issues (20)
- Tests for real signature with various parameters HOT 3
- Tests for all non-tested
- Add a `$custom_headers` parameter to `createRemoteCopy` HOT 1
- Group files info HOT 1
- Concrete class for Akamai CDN token and expire generation
- FileApi.php HOT 9
- Missing URL on File in FileCollection when fetching it from group HOT 4
- Secure Delivery File Transformations Not Working HOT 4
- Access to the raw json response HOT 2
- Question: How do I get the original Image Dimensions HOT 1
- How to get dimensions of an image of a transformed URL? HOT 2
- getOriginalFileUrl() sometimes returns empty string HOT 1
- deleteFile pitches Guzzle Method Not Allowed error HOT 2
- Deprecate PUT /group/{uuid}/storage/ HOT 1
- Show default_effects in file info of group info response HOT 2
- Update webhooks API (event types and versioning)
- Add AWS Rekognition Moderation
- multipage conversion (save_in_group param in documentJobSubmitParameters)
- Signed URL updates
- Update signed URLs implementation to work with ~ and ,
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from uploadcare-php.