99use App \Classes \RcnApi \Exceptions \RcnApiResourceNotFoundException ;
1010use App \Classes \RcnApi \RcnApiClient ;
1111use App \Classes \RcnApi \Resources \WhatNowResource ;
12- use App \Classes \Renderer \Entities \ImageFile ;
13- use App \Classes \Renderer \Services \ImageService ;
14- use App \Classes \Renderer \Services \ImageServiceException ;
1512use App \Events \WhatNow \InstructionCreated ;
1613use App \Events \WhatNow \InstructionDeleted ;
1714use App \Events \WhatNow \InstructionTranslationCreated ;
@@ -36,13 +33,9 @@ final class InstructionController extends ApiController
3633 private $ client ;
3734
3835
39- private $ image ;
40-
41-
42- public function __construct (RcnApiClient $ client , ImageService $ image )
36+ public function __construct (RcnApiClient $ client )
4337 {
4438 $ this ->client = $ client ->whatnow ();
45- $ this ->image = $ image ;
4639 }
4740
4841
@@ -768,24 +761,4 @@ public function publishTranslations($countryCode, Request $request)
768761 }
769762 }
770763
771- public function renderImage (Request $ request , $ instructionId , $ translationCode , $ stageRef )
772- {
773- try {
774- $ revision = $ request ->query ('revision ' ) == 'true ' ;
775- $ image = $ this ->image ->createFromArray ([
776- 'instructionId ' => $ instructionId ,
777- 'translationCode ' => $ translationCode ,
778- 'stageRef ' => $ stageRef ,
779- 'revision ' => $ revision
780- ]);
781- } catch (ImageServiceException $ e ) {
782- return $ this ->respondWithNotFound ($ e , $ e ->getMessage ());
783- }
784-
785- $ filename = $ instructionId . '_ ' . $ translationCode . '_ ' . $ stageRef . '.jpg ' ;
786- $ imageFile = new ImageFile (config ('whatnowimage.directory ' ), $ filename );
787- $ path = $ this ->image ->render ($ image , $ imageFile );
788-
789- return response ()->file ($ path );
790- }
791764}
0 commit comments