Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with version 3.4.3 and 3.5.0 on Laravel 4 #77

Closed
sdebacker opened this issue Mar 2, 2015 · 22 comments
Closed

Bug with version 3.4.3 and 3.5.0 on Laravel 4 #77

sdebacker opened this issue Mar 2, 2015 · 22 comments

Comments

@sdebacker
Copy link
Collaborator

Version 3.4.3 and 3.5.0 are broken, so with Laravel 4.2 I use v3.4.2.
The package doesn't find the image even if it exists. Probably the stream problem ?

@weotch
Copy link
Member

weotch commented Mar 2, 2015

I'm using 3.5.0 on a L4.2 project right now without issue. I did recently change some internals regarding finding images in the filesystem. Can you show me what your src_dirs config is and where the files actually are?

@weotch
Copy link
Member

weotch commented Mar 2, 2015

I wonder if it could be #13 that introduced your issue ...

@JayBizzle
Copy link

I've had to revert back to Coppa 3.4.3 to get my application working again

@weotch
Copy link
Member

weotch commented Mar 2, 2015

Well balls, I had no idea those commits were causing issues. I even added more unit tests to try to harden it. If you can let me know particulars of how you use Croppa, like what you put for src_dirs and where the files are actually located and stuff like that, I can try to make some tests around your environment to fix.

These are the tests designed to validate filesystem stuff: https://github.com/BKWLD/croppa/blob/master/tests/TestCheckForFile.php

@JayBizzle
Copy link

My setup is really simple...just like this...

<img src="{{ Croppa::url('/assets/frontend/imgs/shows/' . $g->show_id . '/' . $g->filename, 300, 200) }}" />

No extra config specified

@weotch
Copy link
Member

weotch commented Mar 2, 2015

Ahh, I think the problem is that I'm checking now (#13 and 3.5.0) that the referenced image is within the src_dir from the config file. The default config expects it to be at public_path()."/uploads" (https://github.com/BKWLD/croppa/blob/master/src/config/config.php#L7) but yours is at public_path()."/assets" and, thus, a 404 is returned. Try publishing the config file and changing that src_dirs config.

@sdebacker
Copy link
Collaborator Author

In my case the config is default:

'src_dirs' => array(
    App::make('path.public'),
),

and images are in /public/uploads folder. I first get a 500 error and have to reload page for the image to show up.

@sdebacker
Copy link
Collaborator Author

issue #74

@weotch
Copy link
Member

weotch commented Mar 2, 2015

Yeah, @sdebacker that sounds different than @JayBizzle 's issue and does sound related to the Response part of the ServiceProvider. However, #74 / #75 fixes an issue that was introduced in 3.6.0 and you're encountering it in 3.5.0. So I'm still stumped.

@sdebacker
Copy link
Collaborator Author

Yes, that's strange. I have the same problem with 4.3.4

@zodthepossum
Copy link

I've been using Croppa for a year now on a couple of Laravel 4.1 sites and suddenly it just stopped producing the quadrant(c).jpg files when I post new images, and is not working properly - images do not render properly in the views only the name shows up. I have not changed anything in my app and am just wondering if you know what could be wrong.
Croppa is declared as "bkwld/croppa": "~3.0" in composer.json

@weotch
Copy link
Member

weotch commented Mar 5, 2015

@zodthepossum can you supply your src_dirs config and the actual location of your src files?

@zodthepossum
Copy link

@weotch i guess this is what you need...

Input::file('attachment')->move(public_path() . '/upload/images', $image->path);
$image->save();

File locations in public/upload/images
let me know if you need more info, it has worked b/4

@weotch
Copy link
Member

weotch commented Mar 5, 2015

So you didn't customize Croppa's src_dirs config var at all then?

@zodthepossum
Copy link

@weotch no i had not done so before, thankyou though it worked!

@zodthepossum
Copy link

@weotch & @sdebacker
still having issues, this time only on production after i successfully uploaded my laravel app to a shared server. the issue now is to get it working i had to move most of the laravel app above public_html (app, bootstrap, vendor & associate files) everything under the public folder is now in /public_html/sputnikart.net (url is sputnikart.net). i did a die dump on a view {{ dd(public_path()) }} and the path is
"/home/abstract/laravelsput/bootstrap"
today i find laravel had created /upload/images folders (permissions altered to 777) under public path & even though i get messages saying image upload is successful, quadrant c files are created, the images do not render properly - any ideas?

@weotch
Copy link
Member

weotch commented Mar 10, 2015

Couple questions:

  1. Does it work without the quadrant option?
  2. Are files being generated in /upload/images? Or anywhere that you can find them?
  3. If I understand you correctly, it sounds like your app is installed at /public_html/sputnikart.net but Laravel is reading the public_path as being /home/abstract/laravelsput/bootstrap ... is that right? So Laravel has your public_path wrong?
  4. Have you tried specifying Croppa @ 4.3.2 in your composer file and seeing if that fixes it?

@zodthepossum
Copy link

@weotch thank you so much for your help, i managed to get public path working properly and upgraded to 4.3.2 - now all ok! thanks again!

@urbankid
Copy link

I had to revert to version 3.4.3 as well to solve the "reference file not found" issue.
My setup has the public folder in a different location than the default Laravel setup.
In other versions I solve it with:

'src_dirs' => array(
// App::make('path.public'),
'../html'
),

but couldn't solve it in the latest version of Croppa.

@weotch
Copy link
Member

weotch commented Mar 30, 2015

Well, what I'm realizing is that I should have made 3.5 a major point release, I didn't realize my tightening the effect of the src_dirs config would break folks use cases.

Next week I'm going to start on a 4.0 release that will change src_dirs again to add support for S3 (#52) via replacing all the disk IO stuff with Flysystem. I intend to tackle #36 with this as well, which will give users more control about where images are found.

@weotch
Copy link
Member

weotch commented Apr 13, 2015

Closing this now that 4.0 is released. There is a new configuration schema (breaking change) that more explicitly expresses how Croppa deals with routes and URLs.

@weotch weotch closed this as completed Apr 13, 2015
@sdebacker
Copy link
Collaborator Author

Very nice new release ! Thanks.

@sdebacker sdebacker changed the title Bug with version 4.3.4 and 3.5.0 on Laravel 4 Bug with version 3.4.3 and 3.5.0 on Laravel 4 Apr 23, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants