     (if (params-validator/valid-result? validation-result)
       (let [{ok :ok result :result} (to-png params)]
         (if ok
-          (twitter/twitter request (rast/to-base64 result))
+          (twitter/twitter request (rastr/to-base64 result))
           (log/wrap-log-error json-error result request :processing)))
       (log/wrap-log-error json-error (params-validator/get-error-message validation-result) request :bad_params))))
 


(defn save-file-and-get-url [data file-name extention]
  (if-let [folder (:saving-folder @state/options)]
    (let [new-file-name (rast/get-file-name-hash file-name)
          path (str folder "/" new-file-name extention)]
      (fs/mkdirs folder)
      (io/copy data (io/file path))

        (if ok
          (if (= response-type "base64")
            (if (params "save")
              (save-file-and-get-url (rastr/to-base64 (.getBytes result)) (get-file-name params) ".base64")
              (json-success (rastr/to-base64 (.getBytes result))))
            (if (params "save")
              (save-file-and-get-url (.getBytes result) (get-file-name params) ".svg")
              (file-success (.getBytes result) (get-file-name params) ".svg")))
