question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Image field cannot be used with big sized image

See original GitHub issue

Bug report

What I did

I made a crud controller using image field. Here’s the image field’s declaration:

CRUD::field('featured_image')
            ->type('image')
            ->label('Featured Image')
            ->crop(true)
            ->aspect_ratio(1.96)
            ->disk('public');

What I expected to happen

Image cropped and uploaded as usual

What happened

for some reason when I use images with big size or big resolution, it returns error 404 method not found for POST /admin/{entity}/{primary_key}

image

image

image

What I’ve already tried to fix it

  • resize the image to small resolution (around 700-800px width) so backpack won’t return 404 error. (always works)
  • convert the image to .jpg (sometimes still return 404 error, intermittent)

And also, this is error is not showing in my local machine. So this is either because of server error, connection (images took some time to upload to server, unlike in localhost), or the particular image problem

Backpack, Laravel, PHP, DB version

When I run php artisan backpack:version the output is:

Local:

PHP VERSION:

PHP 7.4.5 (cli) (built: Apr 14 2020 16:17:34) ( ZTS Visual C++ 2017 x64 ) Copyright © The PHP Group Zend Engine v3.4.0, Copyright © Zend Technologies

LARAVEL VERSION:

v8.19.0@f5f331cee60f1bbe672503b7eb9ba5b22b2ceacb

BACKPACK VERSION:

4.1.30@62856b1f01fc3e05c80140fc22f85ea2aac8368c

Server:

PHP VERSION:

PHP 7.4.13 (cli) (built: Nov 25 2020 21:00:01) ( NTS ) Copyright © The PHP Group Zend Engine v3.4.0, Copyright © Zend Technologies with Zend OPcache v7.4.13, Copyright ©, by Zend Technologies

LARAVEL VERSION:

v8.19.0@f5f331cee60f1bbe672503b7eb9ba5b22b2ceacb

BACKPACK VERSION:

4.1.30@62856b1f01fc3e05c80140fc22f85ea2aac8368c

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
promatikcommented, Feb 24, 2021

@mahasadhu end up creating the PR, thinking about it twice, it may help some 😅 https://github.com/Laravel-Backpack/docs/pull/239

1reaction
mahasadhucommented, Feb 24, 2021

No problem @promatik 🤝 Yea it could be, since the image field send the image as base64 string (CMIIW).

Understood, if you need me to update the issue title so it can be more easily searched, just tell me.

I’ve also tried to find how to disable those extensions programmatically, but so far no success 😅 I’ll post later if I got any ways to work around it.

Thank you!

Read more comments on GitHub >

github_iconTop Results From Across the Web

php - Error on uploading images with size greater than 1MB
I used to upload images on the server without any problem, but after I installed spatie larave-image-optimizer I ran into some problems.
Read more >
How to Fix Image Upload Issue in WordPress (Step by Step)
Are you unable to upload images to WordPress or seeing broken images in media library? Here's how to fix image upload issues in...
Read more >
Image Field | Form Designer | User Guide | Epi Info
Field names cannot be changed after data collection starts. By default, Epi Info™ expands/contracts the image to fit in the size of the...
Read more >
<img>: The Image Embed element - HTML - MDN Web Docs
Alt text is also displayed on the page if the image can't be loaded ... Use both width and height to set the...
Read more >
12 image formatting mistakes & how to fix them
Rely on an easy-to-use, feature-rich photo editorand follow our guide below to avoid the ... Image size has a big impact on your...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found